summaryrefslogtreecommitdiff
path: root/docs/hooks/leap-autopep8.post-commit.hook
blob: cffb1d53dabca82b74e5220d420b070421b94b5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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