Hello. I would like to see similar functionality StyleCop (С# checker) in checkstyle (ie checkstyle integrates with svn server as svn-hook and rejects the commit if checks fails). I think this feature will very helpful for many developers teams.
As temporal workaround you can make a rule between developers - "do not commit code with warnings to repository", Checkstyle generate warnings, and such warnings in IDE are clearly seen and developer will see them before commit.
Such rule work for us for more then 5 years.
But your request is also good option.
I wrote a small python script as svn pre-commit hook for our repository that triggers the checkstyle.jar with a configured checkstyle.xml on the server.
I'm just counting the lines of the output of checkstyle. If the count is greater than 2 (because checkstyle always prints the two lines: 'Starting audit..' and 'Audit done')
the script refuses the commit as there are checkstyle warnings existent.