diff options
author | Kali Kaneko <kali@leap.se> | 2015-08-31 14:54:52 -0400 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2015-08-31 14:54:52 -0400 |
commit | f4547479fc050f338845f4f546d8dd7c0e4512eb (patch) | |
tree | 0f737c7f102674230f5467ecaf17720e1d28f6eb /docs/leap-autopep8.post-commit.hook | |
parent | dd43dad4b150adb66e571a56a8a5c053dec858d0 (diff) | |
parent | fd27f48a35736d8ba186c423a7de15ffee5143dd (diff) |
Merge tag '0.9.0rc2' into debian/experimental
Tag leap.bitmask version 0.9.0rc2
Diffstat (limited to 'docs/leap-autopep8.post-commit.hook')
-rwxr-xr-x | docs/leap-autopep8.post-commit.hook | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/leap-autopep8.post-commit.hook b/docs/leap-autopep8.post-commit.hook new file mode 100755 index 00000000..cffb1d53 --- /dev/null +++ b/docs/leap-autopep8.post-commit.hook @@ -0,0 +1,15 @@ +#!/bin/sh + +# Auto pep8 correction as a post-commit hook. +# Thanks to http://victorlin.me/posts/2014/02/05/auto-post-commit-pep8-correction + +echo "[+] running autopep8..." +FILES=$(git diff HEAD^ HEAD --name-only --diff-filter=ACM | grep -e '\.py$') + +for f in $FILES +do + # auto pep8 correction + autopep8 --in-place $f +done + +git status |