-
Notifications
You must be signed in to change notification settings - Fork 4
SCANPY-104 Update the package and script name to "pysonar" #174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,4 +1,4 @@ | ||||||
| # pysonar-scanner | ||||||
| # pysonar | ||||||
| A wrapper around SonarScanner CLI, available on PyPI. | ||||||
|
|
||||||
| # Disclaimer | ||||||
|
|
@@ -15,34 +15,34 @@ These changes include configuration parameter names. | |||||
|
|
||||||
| Install with pip: | ||||||
| ``` | ||||||
| pip install pysonar-scanner | ||||||
| pip install pysonar | ||||||
| ``` | ||||||
|
|
||||||
| # Usage | ||||||
|
|
||||||
| Once installed, the `pysonar-scanner` can be run from the command line to perform an analysis. | ||||||
| Once installed, the `pysonar` scanner can be run from the command line to perform an analysis. | ||||||
| It assumes a running SonarQube server or a project configured on SonarCloud. | ||||||
|
|
||||||
| ## Setting up analysis properties | ||||||
|
|
||||||
| In order for the analysis to run, analysis properties need to be defined. | ||||||
| There are multiple ways of providing these properties, described below in descending order of priority: | ||||||
|
|
||||||
| * Through CLI arguments to the `pysonar-scanner` command | ||||||
| * Through CLI arguments to the `pysonar` command | ||||||
| * Under the `[tool.sonar]` key of the `pyproject.toml` file | ||||||
| * Through common properties extracted from the `pyproject.toml` | ||||||
| * In a dedicated `sonar-project.properties` file | ||||||
| * Through environment variables | ||||||
|
|
||||||
| ### Through CLI arguments | ||||||
|
|
||||||
| Analysis properties can be provided as CLI arguments to the `pysonar-scanner` command. | ||||||
| Analysis properties can be provided as CLI arguments to the `pysonar` command. | ||||||
| They follow the same convention as when running the SonarScanner CLI directly | ||||||
| (see [documentation](https://docs.sonarsource.com/sonarqube/9.9/analyzing-source-code/scanners/sonarscanner/#running-from-zip-file)). | ||||||
| This means that analysis properties provided that way should be prepended with `-D`, for instance: | ||||||
|
|
||||||
| ``` | ||||||
| $ pysonar-scanner -Dsonar.login=myAuthenticationToken | ||||||
| $ pysonar -Dsonar.login=myAuthenticationToken | ||||||
| ``` | ||||||
|
|
||||||
| 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 | |||||
| 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: | ||||||
|
|
||||||
| ``` | ||||||
| pysonar-scanner -Dtoml.path="path/to/pyproject.toml" | ||||||
| pysonar -Dtoml.path="path/to/pyproject.toml" | ||||||
| ``` | ||||||
|
|
||||||
| Or: | ||||||
|
|
||||||
| ``` | ||||||
| pysonar-scanner -Dsonar.projectHome="path/to/projectHome" | ||||||
| pysonar -Dsonar.projectHome="path/to/projectHome" | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same thing here:
Suggested change
|
||||||
| ``` | ||||||
|
|
||||||
|
|
||||||
|
|
@@ -127,7 +127,7 @@ It is also possible to define configure the scanner through environment variable | |||||
|
|
||||||
| ``` | ||||||
| $ export SONAR_HOST_URL="http://localhost:9000" | ||||||
| $ pysonar-scanner | ||||||
| $ pysonar | ||||||
| ``` | ||||||
|
|
||||||
| 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/ | |||||
| To install the latest pre-released version of Sonar Scanner Python. Execute the following command: | ||||||
|
|
||||||
| ```shell | ||||||
| pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pysonar-scanner | ||||||
| pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pysonar | ||||||
| ``` | ||||||
|
|
||||||
| # License | ||||||
|
|
||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nitpick: This file should probably be |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: wouldn't make sense to use the pythonic param names here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made the change. Note that the README still mentions the following:
Which should probably be tackled in the SONARPY-156 about updating documentation.