I use the standard yelp commit hooks, they fix these for me, and warn on pyflakes issues