ci: add pre-commit job

This commit is contained in:
jo 2022-11-18 22:24:50 +01:00 committed by Marge Me
parent 0061e82ecd
commit 45630be695
1 changed files with 14 additions and 1 deletions

View File

@ -121,6 +121,20 @@ changelog_snippet:
when: never when: never
- if: $CI_PIPELINE_SOURCE == 'merge_request_event' - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
pre-commit:
stage: lint
image: python:3.10
variables:
PIP_CACHE_DIR: $CI_PROJECT_DIR/.cache/pip
PRE_COMMIT_HOME: $CI_PROJECT_DIR/.cache/pre-commit
cache:
paths:
- $PIP_CACHE_DIR
- $PRE_COMMIT_HOME
before_script:
- pip3 install pre-commit
script:
- pre-commit run --all --color=always --show-diff-on-failure
black: black:
interruptible: true interruptible: true
@ -357,7 +371,6 @@ deploy_documentation:
only: only:
- stable - stable
.docker_publish: .docker_publish:
stage: publish stage: publish
image: egon0/docker-with-buildx-and-git:bash image: egon0/docker-with-buildx-and-git:bash