Skip to content

Commit f3c29ba

Browse files
SCANPY-187 Add project-key argument alternative name to the sonar-project-key cli argument (#216)
1 parent aa51f25 commit f3c29ba

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

CLI_ARGS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
| ------ | ----------- |
1616
| `--sonar-project-base-dir`, `-Dsonar.projectBaseDir` | Directory containing the project to be analyzed. Default is the current directory |
1717
| `--sonar-project-description`, `-Dsonar.projectDescription` | Description of the project |
18-
| `--sonar-project-key`, `-Dsonar.projectKey` | Key of the project that usually corresponds to the project name in SonarQube |
18+
| `--sonar-project-key`, `--project-key`, `-Dsonar.projectKey` | Key of the project that usually corresponds to the project name in SonarQube |
1919
| `--sonar-project-name`, `-Dsonar.projectName` | Name of the project in SonarQube |
2020
| `--sonar-project-version`, `-Dsonar.projectVersion` | Version of the project |
2121
| `--sonar-sources`, `-Dsonar.sources` | The analysis scope for main source code (non-test code) in the project |

src/pysonar_scanner/configuration/cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def __create_parser(cls):
7171
)
7272
parser.add_argument(
7373
"--sonar-project-key",
74+
"--project-key",
7475
"-Dsonar.projectKey",
7576
type=str,
7677
help="Key of the project that usually corresponds to the project name in SonarQube",

tests/unit/test_configuration_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def test_minimal_cli_args(self):
181181

182182
def test_alternative_cli_args(self):
183183
alternatives = [
184-
["-t", "myToken", "-v", "--sonar-project-key", "myProjectKey"],
184+
["-t", "myToken", "-v", "--project-key", "myProjectKey"],
185185
["--sonar-token", "myToken", "--sonar-verbose", "--sonar-project-key", "myProjectKey"],
186186
]
187187
for alternative in alternatives:

0 commit comments

Comments
 (0)