From ca6ac49bbe7175592d53753b027504398865087e Mon Sep 17 00:00:00 2001 From: Maximilian Linhoff Date: Mon, 25 Mar 2024 16:59:50 +0100 Subject: [PATCH 1/3] Fix sonar complaining about statements in notebooks --- sonar-project.properties | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sonar-project.properties b/sonar-project.properties index c00aba61582..e7d5098eaa7 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -3,3 +3,7 @@ sonar.qualitygate.wait=true sonar.language=python sonar.python.coverage.reportPaths=coverage.xml sonar.python.version=3.9 + +# ignore "statement has no effect" in the sphinx-gallery examples +sonar.issue.ignore.multicriteria.r1.ruleKey=python:S905 +sonar.issue.ignore.multicriteria.r1.resourceKey=examples/** From da94b5d6813ccd4a32d9b62e00987bfd83588a56 Mon Sep 17 00:00:00 2001 From: Maximilian Linhoff Date: Mon, 25 Mar 2024 17:06:30 +0100 Subject: [PATCH 2/3] Do not hard-require sonarqube pass --- sonar-project.properties | 1 - 1 file changed, 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index e7d5098eaa7..6710b27263c 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,5 +1,4 @@ sonar.projectKey=cta-observatory_ctapipe_AY52EYhuvuGcMFidNyUs -sonar.qualitygate.wait=true sonar.language=python sonar.python.coverage.reportPaths=coverage.xml sonar.python.version=3.9 From 9112298bf7a578fe089f9dea1ce9f5bdff3bd9ad Mon Sep 17 00:00:00 2001 From: Maximilian Linhoff Date: Mon, 25 Mar 2024 17:37:13 +0100 Subject: [PATCH 3/3] Exclude examples directory from sonar --- sonar-project.properties | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index 6710b27263c..9aee4a4b826 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -3,6 +3,6 @@ sonar.language=python sonar.python.coverage.reportPaths=coverage.xml sonar.python.version=3.9 -# ignore "statement has no effect" in the sphinx-gallery examples -sonar.issue.ignore.multicriteria.r1.ruleKey=python:S905 -sonar.issue.ignore.multicriteria.r1.resourceKey=examples/** +# ignore examples for coverage and issues, these are sphinx-gallery notebook scripts +# which aren't really supported by sonarqube and lead to a lot of false positives +sonar.exclusions=examples/**