After reading a post by Bryce Verdier, and inspired by comments that suggested the Python version of said hook script would not be as nice as the bash version I decided to hack up a quick python version of the same script using pyflakes instead of pylint.
You can download / fork this here if would like to give it a try: https://gist.github.com/1214061 And of course, if you’re like me and you have no idea what to do with this script you can just do the following:
It’s also worth noting that this version is currently really strict. ANY warnings will cause your commit to fail. Of course, replacing pyflakes with pylint again is a simple modification of the syntax_checker variable in the above script.