This includes confining its scope to src/*.java and resources/*.properties.
This can be modified interactively through the checkstyle properties editor.
- Checkstyle config files in resources/checkstyle:
+ Checkstyle config files in utils/checkstyle:
checkstyle.xml : main configuration file with selected checkstyle modules
checkstyle-suppress.xml : rules to exclude certain checks / files
import-control.xml : package import rules
Option 2: on demand on selected code
- right-click on a class or package and Checkstyle | Check code with checkstyle
+ - (or Clear Checkstyle violations to remove checkstyle warnings)
Checkstyle rules
----------------
Suppressing findings
--------------------
- If there are warnings you judge it ok to suppress, your options are
- (from most global to most local scope):
+ If there are warnings you judge it ok to suppress (false positives),
+ your options are (from most global to most local impact):
- remove the rule entirely
- adjust its properties
- add an entry in checkstyle-suppress.xml to skip the file for the rule
- add comments around the reported source lines
- // CHECKSTYLE.OFF: RuleName
+ // CHECKSTYLE.OFF: RuleName 'a comment to justify suppression'
source code here
// CHECKSTYLE.ON: RuleName
The suppression should be as localised as possible, to avoid false negatives.