Reputation: 19661
Checkstyle is balking at some code and I want to add a suppression rule. How do I find the name of the rule that is failing so I can specifically suppress that rule for this section of code?
Upvotes: 4
Views: 1480
Reputation: 17494
If you are using the command line version of Checkstyle, the easiest way would be to look at the XML output report. Use -f xml
to tell Checkstyle to output XML. Violation messages in XML look like this:
<error line="0" severity="error" message="Missing package-info.java file."
source="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocPackageCheck"/>
So here, the check name for use by the suppression filter is JavadocPackage
.
For manual lookup, you have some further options:
Upvotes: 5