Checkstyle¶
Java | Home | Release Notes | Plugin
By default, plugin activates if java sources available (src/main/java
).
Default config contains all possible checks, but some of them are disabled (note that some checkstyle rules are opposite and never intended to be used together). Uncomment check to enable it.
Output¶
8 Checkstyle rule violations were found in 2 files
[Misc | NewlineAtEndOfFile] sample.(Sample.java:1)
File does not end with a newline.
http://checkstyle.sourceforge.net/config_misc.html#NewlineAtEndOfFile
...
Config¶
Tool config options with defaults:
quality {
checkstyleVersion = '8.36.2'
checkstyle = true // false to disable automatic plugin activation
}
Suppress¶
@SuppressWarnings("NewlineAtEndOfFile")
Or with prefix (but require lower cased name):
@SuppressWarnings("checkstyle:newlineatendoffile")
To suppress all violations:
@SuppressWarnings("all")
Or using comments:
// CHECKSTYLE:OFF
..anything..
// CHECKSTYLE:ON