Skip to content

Commit 2fd5bf4

Browse files
committed
Fix warnings in sonar upload output
1 parent 02d7c4f commit 2fd5bf4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

exasol/toolbox/nox/_artifacts.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from nox import Session
1111

1212
from exasol.toolbox.nox._shared import MINIMUM_PYTHON_VERSION
13-
from noxconfig import PROJECT_CONFIG
13+
from noxconfig import PROJECT_CONFIG, Config
1414

1515
COVERAGE_FILE = ".coverage"
1616
COVERAGE_XML = "ci-coverage.xml"
@@ -183,7 +183,7 @@ def _prepare_coverage_xml(session: Session, source: Path) -> None:
183183
session.run(*command)
184184

185185

186-
def _upload_to_sonar(session: Session, sonar_token: str) -> None:
186+
def _upload_to_sonar(session: Session, sonar_token: str, config: Config) -> None:
187187
command = [
188188
"pysonar",
189189
"--sonar-token",
@@ -194,6 +194,10 @@ def _upload_to_sonar(session: Session, sonar_token: str) -> None:
194194
LINT_JSON,
195195
"--sonar-python-bandit-report-paths",
196196
SECURITY_JSON,
197+
"--sonar-python-version",
198+
",".join(config.python_versions),
199+
"--sonar-sources",
200+
config.source
197201
]
198202
session.run(*command)
199203

@@ -203,4 +207,4 @@ def upload_artifacts_to_sonar(session: Session) -> None:
203207
"""Upload artifacts to sonar for analysis"""
204208
sonar_token = session.posargs[0]
205209
_prepare_coverage_xml(session, PROJECT_CONFIG.source)
206-
_upload_to_sonar(session, sonar_token)
210+
_upload_to_sonar(session, sonar_token, PROJECT_CONFIG)

0 commit comments

Comments
 (0)