1
- # pysonar-scanner
1
+ # pysonar
2
2
A wrapper around SonarScanner CLI, available on PyPI.
3
3
4
4
# Disclaimer
@@ -15,34 +15,34 @@ These changes include configuration parameter names.
15
15
16
16
Install with pip:
17
17
```
18
- pip install pysonar-scanner
18
+ pip install pysonar
19
19
```
20
20
21
21
# Usage
22
22
23
- Once installed, the ` pysonar-scanner ` can be run from the command line to perform an analysis.
23
+ Once installed, the ` pysonar ` scanner can be run from the command line to perform an analysis.
24
24
It assumes a running SonarQube server or a project configured on SonarCloud.
25
25
26
26
## Setting up analysis properties
27
27
28
28
In order for the analysis to run, analysis properties need to be defined.
29
29
There are multiple ways of providing these properties, described below in descending order of priority:
30
30
31
- * Through CLI arguments to the ` pysonar-scanner ` command
31
+ * Through CLI arguments to the ` pysonar ` command
32
32
* Under the ` [tool.sonar] ` key of the ` pyproject.toml ` file
33
33
* Through common properties extracted from the ` pyproject.toml `
34
34
* In a dedicated ` sonar-project.properties ` file
35
35
* Through environment variables
36
36
37
37
### Through CLI arguments
38
38
39
- Analysis properties can be provided as CLI arguments to the ` pysonar-scanner ` command.
39
+ Analysis properties can be provided as CLI arguments to the ` pysonar ` command.
40
40
They follow the same convention as when running the SonarScanner CLI directly
41
41
(see [ documentation] ( https://docs.sonarsource.com/sonarqube/9.9/analyzing-source-code/scanners/sonarscanner/#running-from-zip-file ) ).
42
42
This means that analysis properties provided that way should be prepended with ` -D ` , for instance:
43
43
44
44
```
45
- $ pysonar-scanner -Dsonar.login=myAuthenticationToken
45
+ $ pysonar -Dsonar.login=myAuthenticationToken
46
46
```
47
47
48
48
You can use all the argument allowed by __ SonarScanner__ .
@@ -79,13 +79,13 @@ By default, the scanner will expect the `pyproject.toml` file to be present in t
79
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:
80
80
81
81
```
82
- pysonar-scanner -Dtoml .path= "path/to/pyproject.toml"
82
+ pysonar --toml .path "path/to/pyproject.toml"
83
83
```
84
84
85
85
Or:
86
86
87
87
```
88
- pysonar-scanner -Dsonar.projectHome= "path/to/projectHome"
88
+ pysonar --sonar-project-home "path/to/projectHome"
89
89
```
90
90
91
91
@@ -127,7 +127,7 @@ It is also possible to define configure the scanner through environment variable
127
127
128
128
```
129
129
$ export SONAR_HOST_URL="http://localhost:9000"
130
- $ pysonar-scanner
130
+ $ pysonar
131
131
```
132
132
133
133
See the __ SonarScanner__ [ documentation] ( https://docs.sonarsource.com/sonarqube/9.9/analyzing-source-code/scanners/sonarscanner/ ) for more information.
@@ -137,7 +137,7 @@ See the __SonarScanner__ [documentation](https://docs.sonarsource.com/sonarqube/
137
137
To install the latest pre-released version of Sonar Scanner Python. Execute the following command:
138
138
139
139
``` shell
140
- pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pysonar-scanner
140
+ pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pysonar
141
141
```
142
142
143
143
# License
0 commit comments