Almost every VCS has some sort of a hook system that developer can leverage. At work we use Git and write on Python, and for such combination there is a great githooks app that allows to check commited files against pep8, pyflakes, pdb and jslint.
But honestly, I consider that rejecting git push just because of pep8 or pyflakes violations to be evil for projects that did not follow these rules from the very beginning. For example, ScienceWISE project is one of those, and we’re not alone. The good thing is that now we constantly keep track of all violations inside Jenkins and we try to descrease their number with every commit.
But githooks is really useful when it comes to some worst practices checking, especially if these worst practices can be expressed as a string or regex match. So I decided to fork githooks and add my own custom checker. Here are the rules I have now:
As our team grows and people come and go, these simple heuristics should protect from doing really bad things, and I will try to extend and improve these lists while doing more and more code reviews :)
In future I would like to make these expressions in form of a django app, so anyone could add his custom rules.