summaryrefslogtreecommitdiff
path: root/docs/hooks/leap-flake8.pre-commit.hook
diff options
context:
space:
mode:
Diffstat (limited to 'docs/hooks/leap-flake8.pre-commit.hook')
-rwxr-xr-xdocs/hooks/leap-flake8.pre-commit.hook7
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/hooks/leap-flake8.pre-commit.hook b/docs/hooks/leap-flake8.pre-commit.hook
new file mode 100755
index 00000000..b00fd08a
--- /dev/null
+++ b/docs/hooks/leap-flake8.pre-commit.hook
@@ -0,0 +1,7 @@
+#!/bin/sh
+# Auto-check for pep8 so I don't check in bad code
+FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -e '\.py$')
+
+if [ -n "$FILES" ]; then
+ flake8 -r $FILES
+fi