From 9cff77be621074a6c70422fe274d9b69cabafc2b Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Sun, 24 Jun 2018 16:14:58 +0200 Subject: [PATCH] Add blacklist to git hook recommendatio --- doc/development/setup.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/development/setup.rst b/doc/development/setup.rst index 20ae7ce8f5..51bc36760c 100644 --- a/doc/development/setup.rst +++ b/doc/development/setup.rst @@ -122,13 +122,15 @@ for example, to check for any errors in any staged files when committing:: export GIT_WORK_TREE=../ export GIT_DIR=../.git source ../env/bin/activate # Adjust to however you activate your virtual environment - for file in $(git diff --cached --name-only | grep -E '\.py$') + for file in $(git diff --cached --name-only | grep -E '\.py$' | grep -Ev "migrations|mt940\.py|pretix/settings\.py|make_testdata\.py|testutils/settings\.py|tests/settings\.py|pretix/base/models/__init__\.py") do + echo $file git show ":$file" | flake8 - --stdin-display-name="$file" || exit 1 # we only want to lint the staged changes, not any un-staged changes git show ":$file" | isort -df --check-only - | grep ERROR && exit 1 || true done + This keeps you from accidentally creating commits violating the style guide. Working with mails