Skip to content

Commit 76acbf4

Browse files
SCANPY-104 Update the package and script name to "pysonar" (#174)
1 parent 66577d7 commit 76acbf4

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

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 --toml.path "path/to/pyproject.toml"
8383
```
8484

8585
Or:
8686

8787
```
88-
pysonar-scanner -Dsonar.projectHome="path/to/projectHome"
88+
pysonar --sonar-project-home "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

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ classifiers = ['Environment :: Console', 'Intended Audience :: Developers', 'Ope
88
description = 'Sonar Scanner for the Python Ecosystem'
99
keywords = ['sonar', 'sonarqube', 'sonarcloud', 'cleancode']
1010
license = 'LGPL-3.0-only'
11-
name = 'pysonar-scanner'
11+
name = 'pysonar'
1212
readme = 'README.md'
1313
version = "1.0.0"
1414
dynamic = ["dependencies"]
@@ -53,7 +53,7 @@ from = 'src'
5353
include = 'pysonar_scanner'
5454

5555
[tool.poetry.scripts]
56-
pysonar-scanner = 'pysonar_scanner.__main__:scan'
56+
pysonar = 'pysonar_scanner.__main__:scan'
5757

5858
[[tool.poetry.source]]
5959
name = 'jfrog-server'

tests/its/utils/cli_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def __run_analysis_with_debugging(self, workdir: pathlib.Path, params: list[str]
6060
"--listen",
6161
str(DEBUGPY_PORT),
6262
"-m",
63-
"tests.its.utils.pysonar-scanner-debug",
63+
"tests.its.utils.pysonar-debug",
6464
f"--sonar-host-url={self.sq_client.base_url}",
6565
f"--token={token}",
6666
*params,
@@ -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 renamed to tests/its/utils/pysonar-debug.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
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.
22-
The pysonar-scanner-debug is started with the working directory set to the root of the project, so that python
23-
(and pydebug by extension) can find the pysonar-scanner-debug module. However, since the scanner should run in the
21+
This module is the entry point for debugging the pysonar scanner in the its.
22+
The pysonar-debug is started with the working directory set to the root of the project, so that python
23+
(and pydebug by extension) can find the pysonar-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.
2525
26-
The pysonar-scanner-debug expects the PYSONAR_SCANNER_DEBUG_WORKDIR environment variable to be set to the directory
26+
The pysonar-debug expects the PYSONAR_SCANNER_DEBUG_WORKDIR environment variable to be set to the directory
2727
where the scanner should be run. This is set to the directory containing the sources to be analyzed.
2828
"""
2929

0 commit comments

Comments
 (0)