File tree Expand file tree Collapse file tree
src/pysonar_scanner/configuration Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,6 +54,12 @@ def __parse_cli_args(cls) -> argparse.Namespace:
5454 type = str ,
5555 help = "Key of the project that usually corresponds to the project name in SonarQube" ,
5656 )
57+ parser .add_argument (
58+ "--sonar-project-name" ,
59+ "-Dsonar.projectName" ,
60+ type = str ,
61+ help = "Name of the project in SonarQube" ,
62+ )
5763
5864 parser .add_argument (
5965 "-v" ,
Original file line number Diff line number Diff line change @@ -236,5 +236,10 @@ class Property:
236236 default_value = None ,
237237 cli_getter = lambda args : args .sonar_project_key
238238 ),
239+ Property (
240+ name = SONAR_PROJECT_NAME ,
241+ default_value = None ,
242+ cli_getter = lambda args : args .sonar_project_name
243+ ),
239244]
240245# fmt: on
Original file line number Diff line number Diff line change 5151 SONAR_TOKEN ,
5252 SONAR_USER_HOME ,
5353 SONAR_VERBOSE ,
54+ SONAR_PROJECT_NAME ,
5455)
5556
5657
@@ -116,6 +117,8 @@ def test_impossible_os_choice(self):
116117 "myToken" ,
117118 "--sonar-project-key" ,
118119 "myProjectKey" ,
120+ "--sonar-project-name" ,
121+ "myProjectName" ,
119122 "-v" ,
120123 "--sonar-host-url" ,
121124 "mySonarHostUrl" ,
@@ -171,6 +174,7 @@ def test_all_cli_args(self):
171174 expected_configuration = {
172175 SONAR_TOKEN : "myToken" ,
173176 SONAR_PROJECT_KEY : "myProjectKey" ,
177+ SONAR_PROJECT_NAME : "myProjectName" ,
174178 SONAR_VERBOSE : True ,
175179 SONAR_HOST_URL : "mySonarHostUrl" ,
176180 SONAR_SCANNER_SONARCLOUD_URL : "mySonarScannerCloudUrl" ,
You can’t perform that action at this time.
0 commit comments