From ee9043d6b4b3684961066b27be9a0f1cd5731b16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= Date: Sat, 31 Aug 2024 18:42:58 +0200 Subject: [PATCH] CI: Run pre-commit hooks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Expósito Part-of: --- .gitlab-ci.yml | 14 ++++++++++++++ .gitlab-ci/ci.template | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 66425a77..0373f7ad 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -215,6 +215,20 @@ check-whitespace: - sed -i '/^$/N;/^\n$/D' $(git ls-files src/*.{h,c} tools/*.{h,c} udev/*.c) - git diff --exit-code || (echo "ERROR - Duplicated empty lines, please fix" && false) +# +# pre-commit hooks +# + +pre-commit-hooks: + extends: + - .fdo.ci-fairy + stage: sanity check + script: + - python3 -m venv venv + - source venv/bin/activate + - pip3 install pre-commit + - pre-commit run --all-files || true + - git diff --exit-code || (echo "ERROR - Code style errors found, please fix" && false) ################################################################# # # diff --git a/.gitlab-ci/ci.template b/.gitlab-ci/ci.template index 214f6713..3f45e864 100644 --- a/.gitlab-ci/ci.template +++ b/.gitlab-ci/ci.template @@ -203,6 +203,20 @@ check-whitespace: - sed -i '/^$/N;/^\n$/D' $(git ls-files src/*.{h,c} tools/*.{h,c} udev/*.c) - git diff --exit-code || (echo "ERROR - Duplicated empty lines, please fix" && false) +# +# pre-commit hooks +# + +pre-commit-hooks: + extends: + - .fdo.ci-fairy + stage: sanity check + script: + - python3 -m venv venv + - source venv/bin/activate + - pip3 install pre-commit + - pre-commit run --all-files || true + - git diff --exit-code || (echo "ERROR - Code style errors found, please fix" && false) ################################################################# # #