File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed
src/pysonar_scanner/configuration Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,12 @@ def __parse_cli_args(cls) -> argparse.Namespace:
54
54
type = str ,
55
55
help = "Key of the project that usually corresponds to the project name in SonarQube" ,
56
56
)
57
+ parser .add_argument (
58
+ "--sonar-project-name" ,
59
+ "-Dsonar.projectName" ,
60
+ type = str ,
61
+ help = "Name of the project in SonarQube" ,
62
+ )
57
63
58
64
parser .add_argument (
59
65
"-v" ,
Original file line number Diff line number Diff line change @@ -236,5 +236,10 @@ class Property:
236
236
default_value = None ,
237
237
cli_getter = lambda args : args .sonar_project_key
238
238
),
239
+ Property (
240
+ name = SONAR_PROJECT_NAME ,
241
+ default_value = None ,
242
+ cli_getter = lambda args : args .sonar_project_name
243
+ ),
239
244
]
240
245
# fmt: on
Original file line number Diff line number Diff line change 51
51
SONAR_TOKEN ,
52
52
SONAR_USER_HOME ,
53
53
SONAR_VERBOSE ,
54
+ SONAR_PROJECT_NAME ,
54
55
)
55
56
56
57
@@ -116,6 +117,8 @@ def test_impossible_os_choice(self):
116
117
"myToken" ,
117
118
"--sonar-project-key" ,
118
119
"myProjectKey" ,
120
+ "--sonar-project-name" ,
121
+ "myProjectName" ,
119
122
"-v" ,
120
123
"--sonar-host-url" ,
121
124
"mySonarHostUrl" ,
@@ -171,6 +174,7 @@ def test_all_cli_args(self):
171
174
expected_configuration = {
172
175
SONAR_TOKEN : "myToken" ,
173
176
SONAR_PROJECT_KEY : "myProjectKey" ,
177
+ SONAR_PROJECT_NAME : "myProjectName" ,
174
178
SONAR_VERBOSE : True ,
175
179
SONAR_HOST_URL : "mySonarHostUrl" ,
176
180
SONAR_SCANNER_SONARCLOUD_URL : "mySonarScannerCloudUrl" ,
You can’t perform that action at this time.
0 commit comments