From 5519d02f609a87b0ca47a8e82c116811005b6277 Mon Sep 17 00:00:00 2001 From: "Kali Kaneko (leap communications)" Date: Mon, 3 Oct 2016 20:40:03 -0400 Subject: [docs] revamp bitmask dev docs --- docs/hooks/leap-autopep8.post-commit.hook | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 docs/hooks/leap-autopep8.post-commit.hook (limited to 'docs/hooks/leap-autopep8.post-commit.hook') diff --git a/docs/hooks/leap-autopep8.post-commit.hook b/docs/hooks/leap-autopep8.post-commit.hook new file mode 100755 index 0000000..cffb1d5 --- /dev/null +++ b/docs/hooks/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