summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2015-08-04 15:32:01 -0400
committerKali Kaneko <kali@leap.se>2015-08-04 15:32:01 -0400
commita119c4ba82daedcea571950ce6f2e8b09289e5fa (patch)
tree4388368d7ed5e67bf9a764a59279a38133d6a331 /docs
parent96d8555b35b384c2359a3854c9c19c5f7c1c242b (diff)
[style] add pre-commit hook to run flake8
Diffstat (limited to 'docs')
-rwxr-xr-xdocs/leap-flake8.pre-commit.hook7
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/leap-flake8.pre-commit.hook b/docs/leap-flake8.pre-commit.hook
new file mode 100755
index 00000000..b00fd08a
--- /dev/null
+++ b/docs/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