On Thu, Jun 13, 2013 at 10:08:23AM +0200, Richard Biener wrote: > On Wed, Jun 12, 2013 at 10:08 PM, Ondřej Bílka <nel...@seznam.cz> wrote: > > A followup to previous patch is more general pass that changes leading > > spaces to tabs followed by at most 8 spaces. > > > > http://kam.mff.cuni.cz/~ondra/0004-Formatted-by-leading_space.patch > > Btw, rather than these kind of patches I'd appreciate if someone would look > at a simple pre(post?)-commit hook that enforces those whitespace rules. > > Either by adjusting the committed content or by rejecting the commit(?) > It was my next logical step to propose this. For hooks you need a clean source tree or they will pick unrelated code that happens to be in same file.
I had hook ready so I copied it to http://kam.mff.cuni.cz/~ondra/stylepp.tar.bz2 To use it, add DIRECTORY/space_pre_commit to your pre-commit hook. I have other checkes that are bit more controversional (for example space after comma which could trigger reformating of subsequent lines.) For it I could add post commit hook that prints: Stylepp found several problems with formating. See git diff (stylepp.patch file if you prefer) Ondra