[LLVMdev] svn pre-commit hook: help needed

Julien Lerouge jlerouge at apple.com
Wed Feb 18 01:41:51 PST 2009


On Tue, Feb 17, 2009 at 02:21:23PM -0800, Scott Michel wrote:
> Anyone out there interested in helping out with a subversion pre-commit hook
> to:
> 
> - remove trailing whitespace,
> - expand tabs to spaces,
> - detect 80-col violations,
> 
> as well as detect other style guideline breakage?
> 
> I just ran into the trailing whitespace problem: Eclipse and other editors
> like to trim excess whitespace from source. However, when one commits a
> patch with trailing whitespace removed, the extraneous diffs make reading
> the patch more difficult.
> 
> Reply to me privately if you're interested in helping out.
> 
> -scooter

Yet another _fun_ way of doing this is to setup a buildbot slave just
for that. The slave can fix minor stuff like tabs and trailing
whitespaces on its own (checking the changes back in), and yell for
things like 80-col violations and whatnot where the changes would not be
so trivial.

People who don't care are not bothered too much (their code might be
changed by the slave), and fascis^H^H^H^H^H^Hpeople who care can quickly
find out where the errors are.

By setting the tree stable timer for the slave doing the check lower
than the slaves doing the actual builds, no extra build is generated in
case the code is modified.

Beware, some people might try to ddos your buildbot after seeing all
their code rewritten, and some other will simply hate you for all the
yelling ;-)

Julien,

-- 
Julien Lerouge
PGP Key Id: 0xB1964A62
PGP Fingerprint: 392D 4BAD DB8B CE7F 4E5F FA3C 62DB 4AA7 B196 4A62
PGP Public Key from: keyserver.pgp.com



More information about the llvm-dev mailing list