diff --git a/.codeclimate.yml b/.codeclimate.yml new file mode 100644 index 00000000..b12f805d --- /dev/null +++ b/.codeclimate.yml @@ -0,0 +1,7 @@ +engines: + pylint: + enabled: true + channel: "beta" + plugins: + - django + diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c5f0e63b..a5581c54 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,20 +1,22 @@ --- -image: debian:stretch stages: - - lint + - codequality -lint: - stage: lint +code_quality: + stage: codequality + image: docker:stable variables: - LANG: 'en_US.UTF-8' - LC_ALL: 'en_US.UTF-8' - LANGUAGE: 'en_US.UTF-8' + DOCKER_DRIVER: overlay2 + allow_failure: true + services: + - docker:stable-dind script: - - apt-get -qq update - - DEBIAN_FRONTEND=noninteractive apt-get -qq install -y locales python3-django python3-pylint-django - - sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && dpkg-reconfigure --frontend=noninteractive locales && update-locale LANG=en_US.UTF-8 - - pylint3 --load-plugins pylint_django cotisations machines re2o logs topologie preferences search users || if [ $? -ne 1 ]; then exit 0; else exit 1; fi - - - - + - export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/') + - docker run + --env SOURCE_CODE="$PWD" + --volume "$PWD":/code + --volume /var/run/docker.sock:/var/run/docker.sock + "registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code + artifacts: + reports: + codequality: gl-code-quality-report.json