From a119c4ba82daedcea571950ce6f2e8b09289e5fa Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Tue, 4 Aug 2015 15:32:01 -0400 Subject: [style] add pre-commit hook to run flake8 --- docs/leap-flake8.pre-commit.hook | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 docs/leap-flake8.pre-commit.hook 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 -- cgit v1.2.3