View Javadoc
1   /*xml
2   <module name="Checker">
3     <module name="SuppressWithNearbyTextFilter">
4       <property name="nearbyTextPattern"
5         value="-@cs\[(\w+)\] (\w+)"/>
6       <property name="checkPattern" value="$1"/>
7     </module>
8     <module name="TreeWalker">
9       <module name="MagicNumber"/>
10    </module>
11  </module>
12  */
13  package com.puppycrawl.tools.checkstyle.filters.suppresswithnearbytextfilter;
14  // xdoc section -- start
15  public class Example7 {
16    int a = 42; // -@cs[MagicNumber] We do not consider this number as magic.
17    int b = 43; // violation "'43' is a magic number."
18  }
19  // xdoc section -- end