From a9b4554156bac38cd3ca1162326ce9cf554f9b50 Mon Sep 17 00:00:00 2001 From: "Kali Kaneko (leap communications)" Date: Tue, 30 Aug 2016 11:25:27 -0400 Subject: [pkg] add some relevant docs --- docs/leap-autopep8.post-commit.hook | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 docs/leap-autopep8.post-commit.hook (limited to 'docs/leap-autopep8.post-commit.hook') diff --git a/docs/leap-autopep8.post-commit.hook b/docs/leap-autopep8.post-commit.hook new file mode 100755 index 0000000..cffb1d5 --- /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 -- cgit v1.2.3