2024-07-03 18:08:14 +02:00
|
|
|
# @format
|
|
|
|
|
2023-05-22 15:54:10 +02:00
|
|
|
# Based on https://pre-commit.com
|
|
|
|
image: python:alpine
|
|
|
|
gitlab-ci-pre-commit:
|
|
|
|
stage: build
|
|
|
|
before_script:
|
2023-05-22 16:33:40 +02:00
|
|
|
- apk add --no-cache git gcc musl-dev go
|
2024-01-11 21:07:18 +01:00
|
|
|
- pip install pre-commit --break-system-packages
|
2023-05-22 15:54:10 +02:00
|
|
|
script:
|
|
|
|
- pre-commit run --all-files --show-diff-on-failure
|
|
|
|
variables:
|
2023-05-22 16:21:01 +02:00
|
|
|
# Remember to gitignore .cache/**
|
2023-05-22 15:54:10 +02:00
|
|
|
PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit
|
|
|
|
TERM: dumb
|
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- ${PRE_COMMIT_HOME}
|