View Javadoc
1   /*
2   SuppressWithNearbyTextFilter
3   nearbyTextPattern = (default)SUPPRESS CHECKSTYLE (\\w+)
4   checkPattern = (default).*
5   messagePattern = (default)(null)
6   idPattern = (default)(null)
7   lineRange = (default)0
8   
9   com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck
10  fileExtensions = (default)all files
11  ignorePattern = (default)^(package|import) .*
12  max = 90
13  
14  com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck
15  format = (default)^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$
16  applyToPublic = (default)true
17  applyToProtected = (default)true
18  applyToPackage = (default)true
19  applyToPrivate = (default)true
20  
21  
22  */
23  
24  package com.puppycrawl.tools.checkstyle.filters.suppresswithnearbytextfilter;
25  
26  public class InputSuppressWithNearbyTextFilterDefaultConfig {
27  
28      // violation below 'Line is longer than 90 characters (found 94).'
29      void someMethodWithReaaaaaaaaaaaalyLoooooooooooooooooongNaaaaaaaaaaaaaaaaaaaaaaaaaaame() {
30          // filtered violation below 'Line is longer than 90 characters (found 97).'
31          for (int longName = 0; longName < 5; longName++) { // SUPPRESS CHECKSTYLE LineLengthCheck
32              System.out.println(longName);
33              if (longName == 4) {
34                  break;
35              }
36          }
37      }
38  
39      void method() {
40          // filtered violation below 'Line is longer than 90 characters (found 94).'
41          /* SUPPRESS CHECKSTYLE LineLengthCheck */ int ccccccccccccccccccccccccccccccccccc = 3;
42      }
43  
44      final static int badConstant = 5; // violation '.*'badConstant' must match pattern.*'
45  
46      // filtered violation below '.*'badConstant1' must match pattern.*'
47      final static int badConstant1 = 5; /* SUPPRESS CHECKSTYLE ConstantNameCheck */
48  }