Skip to content

Commit c7339de

Browse files
Consistently update to pysonar
1 parent faac6c2 commit c7339de

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

.cirrus.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ analysis_linux_task:
136136
- poetry run pytest --cov-report=xml:coverage.xml --cov-config=pyproject.toml --cov=src --cov-branch tests
137137
- uv venv
138138
- source .venv/bin/activate
139-
- uv pip install pysonar-scanner
139+
- uv pip install pysonar
140140
- . .cirrus/analysis.sh
141141
always:
142142
pytest_artifacts:

.cirrus/analysis.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
function run_analysis {
44
# extra analysis parameters are set in the 'sonar-project.properties'
5-
pysonar-scanner \
5+
pysonar \
66
-Dsonar.host.url="$SONAR_HOST_URL" \
77
-Dsonar.token="$SONAR_TOKEN" \
88
-Dsonar.analysis.buildNumber=$CI_BUILD_NUMBER \

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ The the following keys should be present:
6060

6161
To debug the sonar-scanner being run in the its, the ITs have to be run with `poetry run pytest tests/its --its --debug-its`
6262

63-
The `pysonar-scanner` process will wait until VSCode or any other debug adapter protocol client connects on the port `5678`.
63+
The `pysonar` process will wait until VSCode or any other debug adapter protocol client connects on the port `5678`.
6464

6565
For VSCode, add the following launch configuration in the `configurations` array:
6666
```json

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# pysonar-scanner
1+
# pysonar
22
A wrapper around SonarScanner CLI, available on PyPI.
33

44
# Disclaimer
@@ -15,34 +15,34 @@ These changes include configuration parameter names.
1515

1616
Install with pip:
1717
```
18-
pip install pysonar-scanner
18+
pip install pysonar
1919
```
2020

2121
# Usage
2222

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.
2424
It assumes a running SonarQube server or a project configured on SonarCloud.
2525

2626
## Setting up analysis properties
2727

2828
In order for the analysis to run, analysis properties need to be defined.
2929
There are multiple ways of providing these properties, described below in descending order of priority:
3030

31-
* Through CLI arguments to the `pysonar-scanner` command
31+
* Through CLI arguments to the `pysonar` command
3232
* Under the `[tool.sonar]` key of the `pyproject.toml` file
3333
* Through common properties extracted from the `pyproject.toml`
3434
* In a dedicated `sonar-project.properties` file
3535
* Through environment variables
3636

3737
### Through CLI arguments
3838

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.
4040
They follow the same convention as when running the SonarScanner CLI directly
4141
(see [documentation](https://docs.sonarsource.com/sonarqube/9.9/analyzing-source-code/scanners/sonarscanner/#running-from-zip-file)).
4242
This means that analysis properties provided that way should be prepended with `-D`, for instance:
4343

4444
```
45-
$ pysonar-scanner -Dsonar.login=myAuthenticationToken
45+
$ pysonar -Dsonar.login=myAuthenticationToken
4646
```
4747

4848
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
7979
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:
8080

8181
```
82-
pysonar-scanner -Dtoml.path="path/to/pyproject.toml"
82+
pysonar -Dtoml.path="path/to/pyproject.toml"
8383
```
8484

8585
Or:
8686

8787
```
88-
pysonar-scanner -Dsonar.projectHome="path/to/projectHome"
88+
pysonar -Dsonar.projectHome="path/to/projectHome"
8989
```
9090

9191

@@ -127,7 +127,7 @@ It is also possible to define configure the scanner through environment variable
127127

128128
```
129129
$ export SONAR_HOST_URL="http://localhost:9000"
130-
$ pysonar-scanner
130+
$ pysonar
131131
```
132132

133133
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/
137137
To install the latest pre-released version of Sonar Scanner Python. Execute the following command:
138138

139139
```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
141141
```
142142

143143
# License

tests/its/utils/cli_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def __run_analysis_with_debugging(self, workdir: pathlib.Path, params: list[str]
8181

8282
def __run_analysis_normal(self, workdir: pathlib.Path, params: list[str], token: str) -> CompletedProcess:
8383
command = [
84-
"pysonar-scanner",
84+
"pysonar",
8585
f"--sonar-host-url={self.sq_client.base_url}",
8686
f"--token={token}",
8787
*params,

tests/its/utils/pysonar-scanner-debug.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1919
#
2020
"""
21-
This module is the entry point for debugging the pysonar-scanner in the its.
21+
This module is the entry point for debugging the pysonar scanner in the its.
2222
The pysonar-scanner-debug is started with the working directory set to the root of the project, so that python
2323
(and pydebug by extension) can find the pysonar-scanner-debug module. However, since the scanner should run in the
2424
analyzed project, the working directory is changed to the root of the analyzed project before running the scanner.

0 commit comments

Comments
 (0)