Replace pylint build step with prebuild

Kudos to Robbert Müller https://gitlab.com/mjrider
For implimenting my request to include the gitlab plugin for pylint
This means we don't have to waste time installing anything
This commit is contained in:
Zedifus 2022-03-24 19:34:11 +00:00
parent 1404da082c
commit e259d5c3d7

View File

@ -52,17 +52,16 @@ black:
pylint: pylint:
stage: lint stage: lint
image: python:3.7-slim image: registry.gitlab.com/pipeline-components/pylint:latest
tags: tags:
- "docker" - "docker"
rules: rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"' - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: "$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS" - if: "$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS"
when: never when: never
before_script: # before_script:
# - mkdir -p public/badges public/lint # - mkdir -p public/badges public/lint
# - echo undefined > public/badges/$CI_JOB_NAME.score # - echo undefined > public/badges/$CI_JOB_NAME.score
- pip install pylint-gitlab
script: script:
# - pylint --exit-zero --output-format=text $(find -type f -name "*.py" ! -path "**/.venv/**" ! -path "**/app/migrations/**") | tee /tmp/pylint.txt # - pylint --exit-zero --output-format=text $(find -type f -name "*.py" ! -path "**/.venv/**" ! -path "**/app/migrations/**") | 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 # - sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' /tmp/pylint.txt > public/badges/$CI_JOB_NAME.score