I want to have an opportunity to pass the list of *.java files in commit/changeset to the pre-commit hook which will check those java files for code style.
I've tried to use maven-checkstyle-plugin but it looks like it is not possible to pass to it an arbitrary list of files. Also, running mvn site
builds reports which are not supposed to be used exclusively like a human-readable entity, so it is not trivial to use this report in python scripts (which mercurial hooks basically are).
So the question is: how to check-style an arbitrary list of *.java files in command-line (just like we are checking arbitrary list of python files with pep8, or javascript files with jshint/jslint)?
By style-checking I mean not only printing report to stdout but returning somehow the final result - whether files had or had not passed the guidelines.