diff options
author | Kali Kaneko (leap communications) <kali@leap.se> | 2016-08-30 11:25:27 -0400 |
---|---|---|
committer | Kali Kaneko (leap communications) <kali@leap.se> | 2016-08-30 11:25:35 -0400 |
commit | a9b4554156bac38cd3ca1162326ce9cf554f9b50 (patch) | |
tree | 21dacea8338235181b214fa233f93fdff3c0b022 /docs/leap-autopep8.post-commit.hook | |
parent | 22eec36ff81ae2ec2b924087ed6253894b92278a (diff) |
[pkg] add some relevant docs
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 |