简体   繁体   中英

Checkstyle off is not working for Checkstyle Gradle

I would like to use //@checkstyle:off and //@checkstyle:on to exempt certain part of the code from being check by checkstyle but it is still complaining.

public void invoke() {
    //@checkstyle:off
    String foo="Don't scan me please";
    //@checkstyle:on
}

http://checkstyle.sourceforge.net/config_filters.html#SuppressionCommentFilter . Please add the module to your checkstyle.xml

You can add comments to your code to turn off checkstyle (at various levels) and then back on again through the use of comments in your code. Eg

//CHECKSTYLE:OFF
public void someMethod(String arg1, String arg2, String arg3, String arg4) {
//CHECKSTYLE:ON

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM