From 920af03ab06e6e8a9feaa63a2e6de3000291c3e0 Mon Sep 17 00:00:00 2001 From: Zedifus Date: Sun, 18 Jun 2023 20:29:23 +0100 Subject: [PATCH 1/2] Add SonarCloud CQ --- .gitlab/lint.yml | 22 ++++++++++++++++++++++ sonar-project.properties | 12 ++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 sonar-project.properties diff --git a/.gitlab/lint.yml b/.gitlab/lint.yml index 77b95abd..03a32b08 100644 --- a/.gitlab/lint.yml +++ b/.gitlab/lint.yml @@ -57,3 +57,25 @@ pylint: reports: codequality: codeclimate.json when: always + +# SonarQube/SonarCloud - Code Climate & QA [https://www.sonarsource.com] +sonarcloud-check: + stage: lint + image: + name: sonarsource/sonar-scanner-cli:latest + entrypoint: [""] + tags: + - docker + rules: + - if: "$CODE_QUALITY_DISABLED" + when: never + - if: "$CI_COMMIT_TAG || $CI_COMMIT_BRANCH" + variables: + SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache + GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task + cache: + key: "${CI_JOB_NAME}" + paths: + - .sonar/cache + script: + - sonar-scanner diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 00000000..19f0fa97 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,12 @@ +sonar.projectKey=crafty-controller_crafty-4 +sonar.organization=crafty-controller + +# This is the name and version displayed in the SonarCloud UI. +sonar.projectName=Crafty 4 +sonar.projectVersion=4.1.3 + +# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. +#sonar.sources=. + +# Encoding of the source code. Default is default system encoding +#sonar.sourceEncoding=UTF-8 From a2d52ef4585ea09e21f112b8fd0948462ffe4c0d Mon Sep 17 00:00:00 2001 From: Zedifus Date: Sun, 18 Jun 2023 20:46:18 +0100 Subject: [PATCH 2/2] Configure sonarcloud --- sonar-project.properties | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 19f0fa97..d738e01a 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -3,7 +3,9 @@ sonar.organization=crafty-controller # This is the name and version displayed in the SonarCloud UI. sonar.projectName=Crafty 4 -sonar.projectVersion=4.1.3 +sonar.projectVersion=4.1.2 +sonar.python.version=3.9, 3.10, 3.11 +sonar.exclusions=app/migrations/**, app/frontend/static/assets/vendors/** # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. #sonar.sources=.