View Javadoc
1   /*xml
2   <module name="Checker">
3     <module name="TreeWalker">
4       <module name="TrailingComment"/>
5       <module name="SuppressionXpathSingleFilter">
6         <property name="checks" value="TrailingCommentCheck"/>
7         <property name="query" value="//SINGLE_LINE_COMMENT
8           [./COMMENT_CONTENT[@text=' NOSONAR\n' or @text=' NOPMD\n'
9           or @text=' SUPPRESS CHECKSTYLE\n']]"/>
10      </module>
11    </module>
12  </module>
13  */
14  
15  package com.puppycrawl.tools.checkstyle.checks.trailingcomment;
16  
17  // xdoc section -- start
18  public class Example3 {
19    int a; // SUPPRESS CHECKSTYLE
20    int b; // NOPMD
21    int c; // NOSONAR
22    int d; // violation, not suppressed
23  }
24  // xdoc section -- end