-
Notifications
You must be signed in to change notification settings - Fork 33
/
checkstyle.xml
250 lines (219 loc) · 8.58 KB
/
checkstyle.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
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
<module name="SuppressWarningsFilter"/>
<module name="SeverityMatchFilter">
<property name="severity" value="info"/>
<property name="acceptOnMatch" value="false"/>
</module>
<!-- <module name="NewlineAtEndOfFile">-->
<!-- <property name="lineSeparator" value="lf"/>-->
<!-- </module>-->
<module name="TreeWalker">
<property name="severity" value="error"/>
<!-- This only fails if at least 4 spaces have been used somewhere -->
<!-- Generally, this allows to still use the "smart tabs" feature for certain code alignments -->
<module name="RegexpSinglelineJava">
<property name="format" value="^\t* {4,}"/>
<property name="message" value="Indent must use tab characters"/>
<property name="ignoreComments" value="true"/>
</module>
<!-- Needed to suppress warnings if needed -->
<module name="SuppressWarningsHolder"/>
<module name="SuppressWithNearbyCommentFilter"/>
<module name="SuppressionCommentFilter"/>
<!-- Block checks -->
<!-- Nested blocks are allowed -->
<!--
<module name="AvoidNestedBlocks">
<property name="allowInSwitchCase" value="true"/>
</module>
-->
<module name="LeftCurly"/>
<module name="RightCurly"/>
<!-- Class design -->
<module name="DesignForExtension">
<property name="ignoredAnnotations"
value="After, AfterClass, Before, BeforeClass, Test, Override, Provides"/>
</module>
<module name="FinalClass"/>
<module name="HideUtilityClassConstructor"/>
<module name="InnerTypeLast"/>
<module name="InterfaceIsType"/>
<module name="MutableException"/>
<module name="OneTopLevelClass"/>
<module name="ThrowsCount"/>
<module name="VisibilityModifier">
<property name="protectedAllowed" value="true"/>
<property name="packageAllowed" value="true"/>
<property name="allowPublicFinalFields" value="true"/>
<property name="allowPublicImmutableFields" value="true"/>
</module>
<!-- Coding -->
<module name="AvoidDoubleBraceInitialization"/>
<module name="AvoidNoArgumentSuperConstructorCall"/>
<module name="CovariantEquals"/>
<module name="DeclarationOrder">
<property name="ignoreModifiers" value="true"/>
<property name="ignoreConstructors" value="true"/>
</module>
<module name="DefaultComesLast"/>
<module name="EmptyStatement"/>
<module name="FallThrough"/>
<module name="IllegalCatch"/>
<module name="IllegalThrows"/>
<module name="IllegalType">
<property name="ignoredMethodNames" value="getInstance"/>
</module>
<module name="IllegalType">
<property name="illegalClassNames" value="org.apache.log4j.Logger,org.slf4j.Logger"/>
<message key="illegal.type" value="Use new Logging API: org.apache.logging.log4j.Logger / LogManager"/>
</module>
<module name="IllegalType">
<property name="illegalClassNames" value="java.util.Random"/>
<message key="illegal.type" value="Use java.util.SplittableRandom for better performance and randomness"/>
</module>
<module name="IllegalType">
<property name="illegalClassNames" value="com.google.inject.Singleton"/>
<message key="illegal.type" value="Use javax.inject.Singleton"/>
</module>
<module name="MultipleVariableDeclarations"/>
<module name="NestedForDepth">
<!-- Very high because some code violates it -->
<property name="max" value="7"/>
</module>
<module name="NestedTryDepth">
<property name="max" value="2"/>
</module>
<module name="NoArrayTrailingComma"/>
<module name="NoClone"/>
<module name="NoEnumTrailingComma"/>
<module name="NoFinalizer"/>
<module name="OneStatementPerLine"/>
<module name="OverloadMethodsDeclarationOrder"/>
<module name="PackageDeclaration"/>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<module name="StringLiteralEquality"/>
<module name="UnnecessarySemicolonAfterOuterTypeDeclaration"/>
<module name="UnnecessarySemicolonAfterTypeMemberDeclaration"/>
<module name="UnnecessarySemicolonInEnumeration"/>
<module name="UnnecessarySemicolonInTryWithResources"/>
<!-- Imports -->
<module name="RedundantImport"/>
<module name="UnusedImports"/>
<!-- JavaDoc -->
<module name="AtclauseOrder"/>
<module name="InvalidJavadocPosition"/>
<module name="JavadocContentLocationCheck"/>
<module name="JavadocStyle">
<property name="checkEmptyJavadoc" value="true"/>
</module>
<module name="JavadocType">
<property name="scope" value="protected"/>
<property name="allowMissingParamTags" value="true"/>
</module>
<module name="JavadocMethod">
<property name="accessModifiers" value="public, protected"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
</module>
<module name="MissingJavadocMethod">
<property name="scope" value="protected"/>
<property name="allowMissingPropertyJavadoc" value="true"/>
<property name="allowedAnnotations" value="Override,Inject,Provides"/>
<!-- Relaxed check on common names -->
<property name="ignoreMethodNamesRegex" value="^(is|get|set|remove|add|new|create|main|run|call).*$"/>
<!-- Don't check constructors -->
<property name="tokens" value="METHOD_DEF,ANNOTATION_FIELD_DEF"/>
</module>
<module name="MissingJavadocType">
<property name="scope" value="public"/>
<property name="skipAnnotations" value="Generated,Command,CommandLine.Command"/>
</module>
<module name="NonEmptyAtclauseDescription"/>
<!-- Metrics -->
<module name="JavaNCSS">
<property name="methodMaximum" value="70"/>
<property name="classMaximum" value="800"/>
<property name="fileMaximum" value="1000"/>
</module>
<module name="CyclomaticComplexity">
<property name="switchBlockAsSingleDecisionPoint" value="true"/>
<property name="max" value="20"/>
</module>
<!-- Miscellaneous -->
<module name="ArrayTypeStyle"/>
<module name="AvoidEscapedUnicodeCharacters"/>
<module name="OuterTypeFilename"/>
<module name="TodoComment">
<!-- High priority comments -->
<property name="format" value="(yyyyyy|FIXME)"/>
<message key="todo.match" value="Address this issue or reduce severity"/>
</module>
<module name="UpperEll"/>
<module name="TrailingComment"/>
<module name="Regexp">
<property name="format" value="((System\.(out|err)\.print)|printStackTrace)"/>
<property name="ignoreComments" value="true"/>
<property name="illegalPattern" value="true"/>
<property name="message" value="No printing to console, use a logger."/>
</module>
<!-- Modifier -->
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>
<!-- Naming conventions -->
<module name="AbbreviationAsWordInName"/>
<module name="ClassTypeParameterName"/>
<module name="ConstantName">
<!-- Only public constants are checked -->
<property name="applyToProtected" value="false"/>
<property name="applyToPackage" value="false"/>
<property name="applyToPrivate" value="false"/>
</module>
<module name="IllegalIdentifierName"/>
<module name="InterfaceTypeParameterName"/>
<module name="LambdaParameterName"/>
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName">
<property name="allowOneCharVarInForLoop" value="true"/>
<!-- Underscores are allowed -->
<property name="format" value="^[a-z][a-zA-Z0-9_]*$"/>
</module>
<module name="MemberName"/>
<module name="MethodName"/>
<module name="MethodTypeParameterName"/>
<module name="PackageName"/>
<module name="ParameterName">
<!-- Underscores are allowed -->
<property name="format" value="^[a-z][a-zA-Z0-9_]*$"/>
</module>
<module name="RecordComponentName" />
<module name="RecordTypeParameterName"/>
<module name="StaticVariableName"/>
<module name="TypeName"/>
<!-- Whitespace -->
<module name="EmptyForInitializerPad"/>
<module name="EmptyForIteratorPad"/>
<module name="MethodParamPad"/>
<module name="NoLineWrap"/>
<!--
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"/>
-->
<module name="SingleSpaceSeparator"/>
<module name="WhitespaceAfter"/>
<module name="TypecastParenPad"/>
<module name="EmptyLineSeparator">
<property name="tokens" value="PACKAGE_DEF,CLASS_DEF,INTERFACE_DEF,ENUM_DEF,METHOD_DEF"/>
</module>
<module name="Regexp">
<!-- Trailing whitespaces in comments are allowed -->
<property name="format" value="^(?!(?:[ \t]*?(?:\/?\*\*?|\/\/)[\S \t]+?|[ \t]+$))[\S \t]+[ \t]+$"/>
<property name="illegalPattern" value="true"/>
<property name="message" value="Trailing whitespace"/>
</module>
</module>
</module>