[Freeipa-devel] Git post-commit hook

Petr Viktorin pviktori at redhat.com
Fri Mar 9 17:03:36 UTC 2012


Let me share my post-commit hook with you.

Save this as .git/hooks/post-commit, chmod +x it, and each time you make 
a commit, it will run pylint and a PEP8 check on all .py files you've 
changed.

It takes a long time, but it runs after the commit is made, so you can 
quite safely kill it or switch to a different terminal and continue working.

It's also quite noisy -- IPA doesn't really conform to its style guide, 
mainly because there are lots of long lines. I always like to check 
around the changes I made for little style fixes to sneak into my patch.

yum install python-pep8 for the style checks.

Improvements welcome!

-- 
Petr³
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: post-commit
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20120309/663000ab/attachment.ksh>


More information about the Freeipa-devel mailing list