From b2b29d9ec0774670149f43010affc8e5376b915d Mon Sep 17 00:00:00 2001 From: Alexander Hess Date: Fri, 2 Oct 2020 16:27:48 +0200 Subject: [PATCH] Configure pre-commit hooks - run "fix-branch-references" before every commit - add common pre-commit hooks from the pre-commit framework --- .pre-commit-config.yaml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..40d4f46 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,22 @@ +default_stages: [commit] +fail_fast: true +repos: +- repo: local + hooks: + - id: fix-branch-references + name: Check for wrong branch references + entry: poetry run nox -s fix-branch-references -- + language: system + stages: [commit, merge-commit] + types: [text] +# Enable hooks provided by the pre-commit project to +# enforce rules that local tools could not that easily. +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.2.0 + hooks: + - id: check-added-large-files + args: [--maxkb=250] + - id: check-merge-conflict + - id: no-commit-to-branch + args: [--branch, main] + - id: trailing-whitespace