Skip to content

Commit 28c9953

Browse files
committed
ci: pylint with codeclimate
1 parent c2c402f commit 28c9953

File tree

5 files changed

+462
-433
lines changed

5 files changed

+462
-433
lines changed

.gitlab-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ variables:
6868
QEMU_IMAGE: "${CI_DOCKER_REGISTRY}/qemu-v5.2:2-20230522"
6969
TARGET_TEST_ENV_IMAGE: "$CI_DOCKER_REGISTRY/target-test-env-v5.2:2"
7070

71-
SONARQUBE_SCANNER_IMAGE: "${CI_DOCKER_REGISTRY}/sonarqube-scanner:3"
71+
SONARQUBE_SCANNER_IMAGE: "${CI_DOCKER_REGISTRY}/sonarqube-scanner:5"
7272

7373
PRE_COMMIT_IMAGE: "$CI_DOCKER_REGISTRY/esp-idf-pre-commit:1"
7474

.gitlab/ci/static-code-analysis.yml

+3-9
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,19 @@ check_pylint:
2727
extends:
2828
- .pre_check_template
2929
- .rules:patterns:python-files
30-
- .before_script_minimal
31-
image: $SONARQUBE_SCANNER_IMAGE
3230
artifacts:
3331
when: always
34-
paths:
35-
- pylint-report.txt
32+
reports:
33+
codequality: pylint.json
3634
expire_in: 1 week
3735
script:
38-
- export PYTHONPATH="$IDF_PATH/tools:$IDF_PATH/tools/ci/python_packages:$PYTHONPATH"
3936
- |
4037
if [ -n "$CI_MERGE_REQUEST_IID" ]; then
4138
export files=$(python ${CI_PROJECT_DIR}/tools/ci/ci_get_mr_info.py files ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME} | grep ".py");
4239
else
4340
export files=$(find . -iname "*.py" -print);
4441
fi
45-
- pylint --rcfile=.pylintrc $files -r n --output-format=parseable > pylint-report.txt || exit 0
42+
- run_cmd pylint --exit-zero --load-plugins=pylint_gitlab --output-format=gitlab-codeclimate:pylint.json $files
4643

4744
# build stage
4845
# Sonarqube related jobs put here for this reason:
@@ -83,7 +80,6 @@ check_pylint:
8380
expire_in: 1 week
8481
dependencies: # Here is not a hard dependency relationship, could be skipped when only python files changed. so we do not use "needs" here.
8582
- clang_tidy_check
86-
- check_pylint
8783

8884
code_quality_check:
8985
extends:
@@ -107,7 +103,6 @@ code_quality_check:
107103
-Dsonar.gitlab.ref_name=$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
108104
-Dsonar.host.url=$SONAR_HOST_URL
109105
-Dsonar.login=$SONAR_LOGIN
110-
-Dsonar.python.pylint.reportPath=pylint-report.txt
111106

112107
code_quality_report:
113108
extends:
@@ -124,4 +119,3 @@ code_quality_report:
124119
-Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME
125120
-Dsonar.host.url=$SONAR_HOST_URL
126121
-Dsonar.login=$SONAR_LOGIN
127-
-Dsonar.python.pylint.reportPath=pylint-report.txt

0 commit comments

Comments
 (0)