I want to be able to pass a list of * .java files in a commit / changeset file to a pre-commit hook that will check these java files for code style.
I tried using maven-checkstyle-plugin , but it seems like it is not possible to pass an arbitrary list of files to it. In addition, at startup mvn site, reports are built that should not be used exclusively as a human-readable object, so it is not trivial to use this report in python scripts (mostly hooks).
So the question is: how to check the style of an arbitrary list of * .java files on the command line (just like we check an arbitrary list of python files with pep8 or javascript files with jshint / jslint)?
By style checking, I mean not only printing the report in stdout, but also somehow returning the final result - regardless of whether the files were there or the recommendations failed.
source
share