-
Notifications
You must be signed in to change notification settings - Fork 25
/
checkstyle-config.xml
255 lines (237 loc) · 9.57 KB
/
checkstyle-config.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<!--
These rules require Checkstyle 8.29 or higher.
The rules are applied to Java files only.
Please check the documentation for further information about the applied rules:
https://checkstyle.sourceforge.io/checks.html
-->
<module name="Checker">
<!-- Default severity is set to warning -->
<property name="severity" value="warning"/>
<!-- Only check Java files -->
<property name="fileExtensions" value="java"/>
<module name="SuppressionFilter">
<property name="file" value="checkstyle-suppressions.xml"/>
<property name="optional" value="true"/>
</module>
<!-- Files end with a new line character -->
<module name="NewlineAtEndOfFile"/>
<!-- Checks for size violations -->
<module name="FileLength">
<property name="max" value="2000"/>
</module>
<module name="LineLength">
<property name="max" value="120"/>
<!-- External links in Javadoc (lines starting with '*') can exceed the limit of 120 characters. -->
<property name="ignorePattern" value="^ *.+<a href=.+>"/>
</module>
<!-- Checks on individual Java files -->
<module name="TreeWalker">
<!-- Checks that the outer type name and the file name match -->
<module name="OuterTypeFilename"/>
<!-- Checks that anonymous classes have 80 lines max -->
<module name="AnonInnerLength">
<property name="max" value="80"/>
</module>
<!-- Checks that methods have 80 lines max -->
<module name="MethodLength">
<property name="max" value="150"/>
<property name="countEmpty" value="false"/>
</module>
<!-- Checks that the number of parameters by method doesn't exceed 16 -->
<module name="ParameterNumber">
<property name="max" value="16"/>
</module>
<!-- Checks for blocks -->
<module name="AvoidNestedBlocks"/>
<module name="EmptyBlock"/>
<module name="EmptyCatchBlock">
<property name="severity" value="error"/>
</module>
<module name="LeftCurly"/>
<module name="NeedBraces">
<property name="severity" value="error"/>
</module>
<module name="RightCurly"/>
<!-- Checks for class design -->
<module name="FinalClass"/>
<module name="HideUtilityClassConstructor"/>
<module name="InnerTypeLast"/>
<module name="InterfaceIsType"/>
<module name="OneTopLevelClass"/>
<!-- Checks that the number of throws doesn't exceed 10 -->
<module name="ThrowsCount">
<property name="max" value="10"/>
</module>
<!-- Checks for imports -->
<module name="AvoidStarImport">
<property name="severity" value="error"/>
</module>
<module name="IllegalImport"/>
<module name="RedundantImport">
<property name="severity" value="error"/>
</module>
<module name="UnusedImports"/>
<!-- Checks for coding style -->
<module name="ArrayTypeStyle"/>
<module name="AvoidInlineConditionals"/>
<module name="CommentsIndentation"/>
<module name="DeclarationOrder"/>
<module name="DefaultComesLast"/>
<module name="EmptyStatement"/>
<module name="EqualsAvoidNull">
<property name="severity" value="error"/>
</module>
<module name="FallThrough"/>
<module name="FinalLocalVariable"/>
<module name="FinalParameters"/>
<module name="IllegalToken">
<property name="severity" value="error"/>
</module>
<module name="Indentation"/>
<module name="InnerAssignment"/>
<module name="MissingSwitchDefault"/>
<module name="ModifiedControlVariable">
<property name="severity" value="error"/>
</module>
<module name="MultipleStringLiterals">
<property name="id" value="multipleStringLiteralsRule"/>
<property name="allowedDuplicates" value="4"/>
</module>
<module name="MultipleVariableDeclarations">
<property name="severity" value="error"/>
</module>
<module name="NestedForDepth">
<property name="max" value="2"/>
</module>
<module name="NestedIfDepth">
<property name="max" value="3"/>
</module>
<module name="NestedTryDepth">
<property name="max" value="2"/>
</module>
<module name="OneStatementPerLine">
<property name="severity" value="error"/>
</module>
<module name="OverloadMethodsDeclarationOrder"/>
<module name="PackageDeclaration"/>
<module name="ParameterAssignment"/>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<module name="StringLiteralEquality">
<property name="severity" value="error"/>
</module>
<module name="UnnecessaryParentheses">
<property name="severity" value="info"/>
</module>
<module name="UnnecessarySemicolonAfterTypeMemberDeclaration"/>
<module name="UnnecessarySemicolonInEnumeration"/>
<module name="UnnecessarySemicolonInTryWithResources"/>
<module name="UpperEll"/>
<!-- Checks for naming conventions -->
<module name="CatchParameterName"/>
<module name="ClassTypeParameterName">
<property name="format" value="^[A-Z][A-Za-z]*$"/>
</module>
<module name="ConstantName"/>
<module name="InterfaceTypeParameterName"/>
<module name="LambdaParameterName">
<property name="severity" value="error"/>
</module>
<module name="LocalFinalVariableName">
<property name="severity" value="error"/>
</module>
<module name="LocalVariableName">
<property name="severity" value="error"/>
</module>
<module name="MemberName">
<property name="severity" value="error"/>
</module>
<module name="MethodName"/>
<module name="MethodTypeParameterName"/>
<module name="PackageName">
<property name="severity" value="error"/>
</module>
<module name="ParameterName">
<property name="severity" value="error"/>
</module>
<module name="StaticVariableName">
<property name="severity" value="error"/>
</module>
<module name="TypeName">
<property name="severity" value="error"/>
</module>
<!-- Checks for modifiers -->
<module name="ClassMemberImpliedModifier">
<property name="violateImpliedStaticOnNestedEnum" value="false"/>
</module>
<module name="ModifierOrder"/>
<module name="RedundantModifier">
<property name="tokens" value="METHOD_DEF, VARIABLE_DEF, ANNOTATION_FIELD_DEF, INTERFACE_DEF, CTOR_DEF,
CLASS_DEF, ENUM_DEF"/>
</module>
<!-- Checks for whitespaces -->
<module name="EmptyLineSeparator">
<property name="allowNoEmptyLineBetweenFields" value="true"/>
</module>
<module name="GenericWhitespace"/>
<module name="MethodParamPad"/>
<module name="NoLineWrap"/>
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"/>
<module name="ParenPad"/>
<module name="SeparatorWrap">
<property name="option" value="eol"/>
<property name="tokens" value="COMMA"/>
</module>
<module name="SeparatorWrap">
<property name="option" value="nl"/>
<property name="tokens" value="DOT"/>
</module>
<module name="SingleSpaceSeparator"/>
<module name="TypecastParenPad"/>
<module name="WhitespaceAfter"/>
<module name="WhitespaceAround"/>
<!-- Checks for annotations -->
<module name="AnnotationLocation">
<property name="allowSamelineParameterizedAnnotation" value="false"/>
</module>
<module name="AnnotationUseStyle"/>
<module name="MissingDeprecated"/>
<module name="MissingOverride"/>
<!-- Checks for complexity -->
<module name="BooleanExpressionComplexity">
<property name="max" value="5"/>
</module>
<module name="CyclomaticComplexity">
<property name="max" value="20"/>
</module>
<!-- Checks for Javadoc -->
<module name="AtclauseOrder"/>
<module name="NonEmptyAtclauseDescription"/>
<module name="InvalidJavadocPosition"/>
<module name="JavadocBlockTagLocation"/>
<module name="JavadocContentLocationCheck"/>
<module name="JavadocMethod">
<property name="validateThrows" value="true"/>
</module>
<module name="JavadocStyle">
<property name="endOfSentenceFormat" value="([.?!:][ \t\n\r\f])|([.?!:]$)"/>
</module>
<module name="JavadocVariable">
<property name="scope" value="protected"/>
</module>
<module name="MissingJavadocMethod">
<property name="ignoreMethodNamesRegex" value="^[gs]et[A-Z][a-zA-Z0-9]*$"/>
<property name="scope" value="protected"/>
</module>
<module name="MissingJavadocType">
<property name="scope" value="public"/>
</module>
<module name="SingleLineJavadoc"/>
</module>
</module>