Skip to content
Snippets Groups Projects
Commit 50d6b091 authored by Marco Clemencic's avatar Marco Clemencic
Browse files

Run pre-commit checks in Gitlab-CI

parent d62492d8
No related branches found
No related tags found
No related merge requests found
variables:
TARGET_BRANCH: master
run-checks:
image: python:3.9
variables:
PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- ${CI_PROJECT_DIR}/.cache
script:
- python -m venv .cache/pre-commit-venv
- . .cache/pre-commit-venv/bin/activate
- pip install pre-commit
- pre-commit --version
- git fetch origin master
- pre-commit run --from-ref FETCH_HEAD --to-ref HEAD
...@@ -5,6 +5,9 @@ repos: ...@@ -5,6 +5,9 @@ repos:
- id: check-yaml - id: check-yaml
# this is needed to allow custom classes in YAML # this is needed to allow custom classes in YAML
entry: check-yaml --unsafe entry: check-yaml --unsafe
files: '.*.yml(/.*)?'
exclude: '/IOVs$'
types: [file]
- id: end-of-file-fixer - id: end-of-file-fixer
- id: trailing-whitespace - id: trailing-whitespace
- id: check-merge-conflict - id: check-merge-conflict
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment