You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
4. Under the `[tool.sonar]` key of the `pyproject.toml` file
30
+
5. In a dedicated `sonar-project.properties` file
31
+
6. Through common properties extracted from the `pyproject.toml`
36
32
37
33
### Through CLI arguments
38
34
39
35
Analysis properties can be provided as CLI arguments to the `pysonar` command.
40
-
They follow the same convention as when running the SonarScanner CLI directly
41
-
(see [documentation](https://docs.sonarsource.com/sonarqube/9.9/analyzing-source-code/scanners/sonarscanner/#running-from-zip-file)).
36
+
They can be provided in a similar way as when running the SonarScanner CLI directly
37
+
(see [documentation](https://docs.sonarsource.com/sonarqube-server/2025.1/analyzing-source-code/scanners/sonarscanner/#running-from-zip-file)).
42
38
This means that analysis properties provided that way should be prepended with `-D`, for instance:
43
39
44
40
```
45
-
$ pysonar -Dsonar.login=myAuthenticationToken
41
+
$ pysonar -Dsonar.token=myAuthenticationToken
46
42
```
47
43
48
-
You can use all the argument allowed by __SonarScanner__.
49
-
For more information on __SonarScanner__ please refer to the [SonarScanner documentation](https://docs.sonarsource.com/sonarqube/9.9/analyzing-source-code/scanners/sonarscanner/)
44
+
You can use all the arguments allowed by __SonarScanner__.
45
+
For more information on __SonarScanner__ please refer to the [SonarScanner documentation](https://docs.sonarsource.com/sonarqube-server/2025.1/analyzing-source-code/analysis-parameters/).
46
+
47
+
Additionally, some common properties can be provided using
50
48
51
49
### With a pyproject.toml file
52
50
@@ -75,32 +73,31 @@ The configuration parameters can be found in the [SonarQube documentation](https
75
73
In the `pyproject.toml` file the prefix `sonar.` for parameter keys should be omitted.
76
74
For example, `sonar.scm.provider` in the documentation will become `scm.provider` in the `pyproject.toml` file.
77
75
78
-
By default, the scanner will expect the `pyproject.toml` file to be present in the current directory.
79
-
However, its path can be provided manually through the `toml.path` ([SCANPY-40](https://sonarsource.atlassian.net/jira/software/c/projects/PYSCAN/issues/PYSCAN-40)) CLI argument as well as through the `sonar.projectHome` argument. For instance:
76
+
By default, the scanner will expect the `pyproject.toml` file to be present in the current directory. However, its path can be provided manually through the `toml-path` CLI argument as well as through the `sonar.projectBaseDir` argument. For instance:
This is currently supported only for projects using `poetry`.
94
+
### Through project properties extracted from the `pyproject.toml`
98
95
99
-
The Sonar scanner will then use the project name and version defined through Poetry, they won't have to be duplicated under a dedicated `tool.sonar` section.
96
+
When a `pyproject.toml` file is available, the scanner can deduce analysis properties from the project configuration. This is currently supported only for projects using `poetry`.
100
97
101
98
### With a sonar-project.properties file
102
99
103
-
Exactly like [__SonarScanner__](https://docs.sonarsource.com/sonarqube/9.9/analyzing-source-code/scanners/sonarscanner/),
100
+
Exactly like [__SonarScanner__](https://docs.sonarsource.com/sonarqube-server/2025.1/analyzing-source-code/scanners/sonarscanner/),
104
101
the analysis can also be configured with a `sonar-project.properties` file:
See the __SonarScanner__[documentation](https://docs.sonarsource.com/sonarqube/9.9/analyzing-source-code/scanners/sonarscanner/) for more information.
130
+
See the __SonarScanner__[documentation](https://docs.sonarsource.com/sonarqube-server/2025.1/setup-and-upgrade/environment-variables/) for more information.
0 commit comments