# https://hub.docker.com/_/python
image: python:3
+include:
+ - local: .gitlab/gitlab-templates.yml
+ - local: .gitlab/pylint.yml
+
variables:
#XDG_CACHE_HOME: "$CI_PROJECT_DIR/.cache"
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache"
--- /dev/null
+pylint:
+ stage: test
+ image: python:3.7-slim
+ before_script:
+ - mkdir -p public/badges public/lint
+ - echo undefined > public/badges/$CI_JOB_NAME.score
+ - pip install pylint_gitlab
+ script:
+ - pylint --exit-zero --output-format=text sima | tee /tmp/pylint.txt
+ - sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' /tmp/pylint.txt > public/badges/$CI_JOB_NAME.score
+ - pylint --exit-zero --output-format=pylint_gitlab.GitlabCodeClimateReporter sima > codeclimate.json
+ - pylint --exit-zero --output-format=pylint_gitlab.GitlabPagesHtmlReporter sima > public/lint/index.html
+ after_script:
+ - anybadge --overwrite --label $CI_JOB_NAME --value=$(cat public/badges/$CI_JOB_NAME.score) --file=public/badges/$CI_JOB_NAME.svg 4=red 6=orange 8=yellow 10=green
+ - |
+ echo "Your score is: $(cat public/badges/$CI_JOB_NAME.score)"
+ artifacts:
+ expire_in: 30 days
+ paths:
+ - public
+ reports:
+ codequality: codeclimate.json
+ when: always
+