I need to write a Git pre commit hook in Java, which would check if the code commited by the developer is formatted according to a specific eclipse code formatter before actually commiting it, otherwise reject it from commiting. Is it possible to write the pre commit hook in Java?
Share
The idea is to call a script which in turns call your java program (checking the format).
You can see here an example written in python, which calls java.
This other example calls directly
ant, in order to execute an ant script (which in turns call a Java JUnit test suite)