Is there a simple CLI Java linter? [closed]
Solution 1:
- SpotBugs (earlier Findbugs) for finding existing bugs. VERY GOOD!
- PMD for finding patterns that can lead to bugs (e.g. unused variables)
- Checkstyle to enforce coding standards and conventions (e.g. whitespace, Javadoc)
- Error Prone hooks right into your application's compile step
- clang-format supports java and may be available on your system already
All these tools have some overlapping rules. There are many other similar tools, but these are the most popular and supported.
Solution 2:
Also, check out Sonar, which combines many of the other tools and provides a nice view for it too.
rules from Checkstyle, FindBugs, PMD, Clirr, fb-contrib.
Not sure exactly how to add it to a post-commit hook, but http://docs.codehaus.org/display/SONAR/Analyzing+with+Maven might be a good starting point (especially if you're using maven).
Maybe even consider using one of the approaches listed in http://docs.codehaus.org/display/SONAR/Continuous+Integration since it seems that you might be trying to look for better tooling for your whole team ("Though some subset of those features would be better that what we have now - nothing!"