Last active
October 19, 2017 21:47
-
-
Save Suor/ccac0511e2e9c5a2d282d47f2c6850a0 to your computer and use it in GitHub Desktop.
Flake8 git pre-commit hook that works
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
FILES=`git diff --cached --name-status | awk '$1 != "D" {print $2}' | grep -E '[.]py$' | grep -v migrations` | |
[ "$NOCHECK" != "" ] || [ "$FILES" = "" ] || flake8 $FILES || exit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Flake8 has its own pre-commit hook, but it:
/tmp/random_stuff/...
,