4 ms·
Just posted this to the blog, thought I would repost here too: I recently wrote a pre-commit hook that runs pylint on my Python files. http://fitzgeraldnick.c
by mnemonik 17y ago
Just posted this to the blog, thought I would repost here too:
I recently wrote a pre-commit hook that runs pylint on my Python files.
http://fitzgeraldnick.com/weblog/9/ http://fitzgeraldnick.com/weblog/9/
“git diff –staged –name-only HEAD” will get you the files that are about to be committed and then you can check if they end with “.php” (or “.py” in my case) and go from there. I also check to see if “#!” and “python” are in the first line of a file because my pre-commit hook is written in python but doesn’t have an extension, just a crunch bang.