1   <?xml version="1.0"?>
2   <!DOCTYPE module PUBLIC
3             "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
4             "https://checkstyle.org/dtds/configuration_1_3.dtd">
5   
6   <module name = "Checker">
7       <property name="charset" value="UTF-8"/>
8   
9       <!-- do not change severity to 'error', as that will hide errors caused by exceptions -->
10      <property name="severity" value="warning"/>
11  
12      <!-- haltOnException is required for exception fixes and reporting of all exceptions -->
13      <property name="haltOnException" value="false"/>
14  
15      <!-- BeforeExecutionFileFilters is required for sources of java9 -->
16      <module name="BeforeExecutionExclusionFileFilter">
17          <property name="fileNamePattern" value="module\-info\.java$" />
18      </module>
19  
20      <module name="TreeWalker">
21    <!-- Imports -->
22          <module name="AvoidStarImport"/>
23          <module name="AvoidStaticImport"/>
24          <module name="CustomImportOrder">
25              <property name="customImportOrderRules"
26                        value="STATIC###STANDARD_JAVA_PACKAGE###SPECIAL_IMPORTS###THIRD_PARTY_PACKAGE"/>
27              <property name="standardPackageRegExp" value="^java\."/>
28              <property name="specialImportsRegExp" value="^javax\."/>
29              <property name="thirdPartyPackageRegExp" value="^org\."/>
30              <property name="sortImportsInGroupAlphabetically" value="true"/>
31              <property name="separateLineBetweenGroups" value="true"/>
32          </module>
33          <module name="IllegalImport"/>
34          <module name="ImportOrder">
35              <property name="groups" value="/^java\./,javax,org"/>
36              <property name="ordered" value="true"/>
37              <property name="separated" value="true"/>
38              <property name="option" value="top"/>
39              <property name="sortStaticImportsAlphabetically" value="true"/>
40          </module>
41          <module name="RedundantImport"/>
42          <module name="UnusedImports"/>
43  
44          <!-- Metrics -->
45          <module name="BooleanExpressionComplexity">
46              <property name="max" value="7"/>
47          </module>
48          <module name="ClassDataAbstractionCoupling">
49              <!-- Default classes are also listed -->
50              <property name="excludedClasses"
51                        value="boolean, byte, char, double, float, int, long, short, void,
52                           Boolean, Byte, Character, Double, Float, Integer, Long, Short, Void,
53                           Object, Class, String, StringBuffer, StringBuilder,
54                           ArrayIndexOutOfBoundsException, Exception, RuntimeException,
55                           IllegalArgumentException, IllegalStateException,
56                           IndexOutOfBoundsException, NullPointerException, Throwable,
57                           SecurityException, UnsupportedOperationException, List, ArrayList,
58                           Deque, Queue, LinkedList, Set, HashSet, SortedSet, TreeSet, Map,
59                           HashMap, SortedMap, TreeMap, DetailsAST, CheckstyleException,
60                           UnsupportedEncodingException, BuildException, ConversionException,
61                           FileNotFoundException, TestException"/>
62          </module>
63          <module name="ClassFanOutComplexity">
64              <property name="max" value="25"/>
65              <!-- Default classes are also listed -->
66              <property name="excludedClasses"
67                        value="boolean, byte, char, double, float, int, long, short,
68                           void, Boolean, Byte, Character, Double, Float, Integer,
69                           Long, Short, Void, Object, Class, String, StringBuffer,
70                           StringBuilder, ArrayIndexOutOfBoundsException, Exception,
71                           RuntimeException, IllegalArgumentException, IllegalStateException,
72                           IndexOutOfBoundsException, NullPointerException, Throwable,
73                           SecurityException, UnsupportedOperationException, List, ArrayList,
74                           Deque, Queue, LinkedList, Set, HashSet, SortedSet, TreeSet, Map,
75                           HashMap, SortedMap, TreeMap, DetailsAST, CheckstyleException,
76                           UnsupportedEncodingException, BuildException, ConversionException,
77                           FileNotFoundException, TestException, Log, Sets, Multimap,
78                           TokenStreamRecognitionException, RecognitionException,
79                           TokenStreamException, IOException, Override, Deprecated, SafeVarargs,
80                           SuppressWarnings, FunctionalInterface"/>
81          </module>
82          <module name="CyclomaticComplexity">
83              <property name="switchBlockAsSingleDecisionPoint" value="true"/>
84          </module>
85          <module name="JavaNCSS"/>
86          <module name="NPathComplexity"/>
87  
88          <!-- Misc -->
89          <module name="ArrayTypeStyle"/>
90          <module name="AvoidEscapedUnicodeCharacters">
91              <property name="allowIfAllCharactersEscaped" value="true"/>
92          </module>
93          <module name="CommentsIndentation"/>
94          <module name="DescendantToken"/>
95          <module name="FinalParameters">
96              <!--
97                we will not use that fanatic validation, extra modifiers pollute a code
98                it is better to use extra validation(Check) that argument is reassigned
99                But this Check will exists as it was created by community demand.
100             -->
101             <property name="severity" value="ignore"/>
102         </module>
103         <module name="Indentation">
104             <property name="basicOffset" value="4"/>
105             <property name="braceAdjustment" value="0"/>
106             <property name="caseIndent" value="4"/>
107             <property name="throwsIndent" value="8"/>
108         </module>
109         <module name="OuterTypeFilename"/>
110         <module name="TodoComment">
111             <property name="format" value="(TODO)|(FIXME)" />
112         </module>
113         <!-- till https://github.com/checkstyle/checkstyle/issues/7388 -->
114         <module name="TodoComment">
115             <property name="id" value="commentStartWithSpace"/>
116             <property name="format" value="^([^\s\/*])"/>
117             <message key="todo.match" value="Comment text should start with space."/>
118         </module>
119         <module name="TrailingComment"/>
120         <module name="UncommentedMain">
121             <property name="excludedClasses" value="\.(Main|JavadocPropertiesGenerator)$"/>
122         </module>
123         <module name="UpperEll"/>
124 
125         <!-- Modifiers -->
126         <module name="ClassMemberImpliedModifier">
127             <!-- effectively the opposite of RedundantModifier, so output must be ignored -->
128             <property name="severity" value="ignore"/>
129         </module>
130         <module name="InterfaceMemberImpliedModifier">
131             <!-- effectively the opposite of RedundantModifier, so output must be ignored -->
132             <property name="severity" value="ignore"/>
133         </module>
134         <module name="ModifierOrder"/>
135         <module name="RedundantModifier"/>
136 
137          <!-- usuppress javadoc parsing errors, as we test Check not a parser -->
138          <module name="SuppressionXpathSingleFilter">
139             <property name="message" value="Javadoc comment at column \d+ has parse error"/>
140          </module>
141     </module>
142     <!-- as we run on regression even on non-compiled files we need to skip exceptions on them -->
143     <module name="SuppressionSingleFilter">
144       <property name="message" value="Exception occurred while parsing"/>
145       <property name="checks" value="Checker"/>
146     </module>
147 </module>