-
Notifications
You must be signed in to change notification settings - Fork 2
/
checkstyle.xml
358 lines (341 loc) · 16.6 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
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" "https://checkstyle.org/dtds/configuration_1_3.dtd">
<!--
SPDX-FileCopyrightText: © Vegard IT GmbH (https://vegardit.com)
SPDX-FileContributor: Sebastian Thomschke
SPDX-License-Identifier: Apache-2.0
SPDX-ArtifactOfProjectHomePage: https://github.com/vegardit/vegardit-maven-parent
-->
<!--
Checkstyle-Configuration: vegardit.com Checks
Description: none
-->
<module name="Checker">
<property name="severity" value="warning" />
<module name="TreeWalker">
<!-- Annotations -->
<module name="AnnotationLocation" />
<module name="AnnotationUseStyle">
<property name="elementStyle" value="compact" />
</module>
<module name="MissingOverride" />
<module name="PackageAnnotation" />
<!-- JavaDoc -->
<module name="AtclauseOrder" />
<module name="InvalidJavadocPosition" />
<module name="JavadocBlockTagLocation" />
<module name="JavadocContentLocation" />
<module name="JavadocMethod">
<property name="allowMissingParamTags" value="true" />
<property name="allowMissingReturnTag" value="true" />
</module>
<module name="JavadocMissingLeadingAsterisk">
<property name="violateExecutionOnNonTightHtml" value="false" />
</module>
<module name="JavadocMissingWhitespaceAfterAsterisk" />
<module name="JavadocTagContinuationIndentation">
<property name="offset" value="3" />
</module>
<module name="NonEmptyAtclauseDescription" />
<module name="RegexpSinglelineJava">
<property name="format" value="@author" />
<property name="minimum" value="1" />
<property name="maximum" value="99" />
<message key="regexp.minimum" value="Java file is missing @author tag." />
</module>
<module name="RequireEmptyLineBeforeBlockTagGroup" />
<module name="SingleLineJavadoc" />
<!-- Naming Conventions -->
<module name="AbbreviationAsWordInName">
<property name="allowedAbbreviationLength" value="4" />
</module>
<module name="CatchParameterName" />
<module name="ConstantName">
<metadata name="net.sf.eclipsecs.core.comment" value="Non-private constants" />
<property name="applyToPrivate" value="false" />
</module>
<module name="ConstantName">
<metadata name="net.sf.eclipsecs.core.comment" value="Private constants" />
<property name="format" value="^[_A-Z][A-Z0-9]*(_[A-Z0-9]+)*$" />
<property name="applyToPublic" value="false" />
<property name="applyToProtected" value="false" />
<property name="applyToPackage" value="false" />
</module>
<module name="IllegalIdentifierName" />
<module name="LambdaParameterName" />
<module name="LocalFinalVariableName">
<property name="format" value="^[a-z][_a-zA-Z0-9]*$" />
</module>
<module name="LocalVariableName">
<property name="format" value="^[a-z][_a-zA-Z0-9]*$" />
</module>
<module name="MemberName">
<metadata name="net.sf.eclipsecs.core.comment" value="Non-Private Members" />
<property name="format" value="^[a-z][_a-zA-Z0-9]*$" />
<property name="applyToPrivate" value="false" />
</module>
<module name="MemberName">
<metadata name="net.sf.eclipsecs.core.comment" value="Private Members" />
<property name="format" value="^[_a-z][_a-zA-Z0-9]*$" />
<property name="applyToPublic" value="false" />
<property name="applyToProtected" value="false" />
<property name="applyToPackage" value="false" />
</module>
<module name="MethodName">
<property name="format" value="^[_a-z][_a-zA-Z0-9]*$" />
</module>
<module name="PackageName" />
<module name="ParameterName">
<property name="accessModifiers" value="public" />
</module>
<module name="StaticVariableName">
<metadata name="net.sf.eclipsecs.core.comment" value="Private Fields" />
<property name="format" value="^[_a-z][_a-zA-Z0-9]*$" />
<property name="applyToPublic" value="false" />
<property name="applyToProtected" value="false" />
<property name="applyToPackage" value="false" />
</module>
<module name="StaticVariableName">
<metadata name="net.sf.eclipsecs.core.comment" value="Non-Private Fields" />
<property name="format" value="^[a-z][_a-zA-Z0-9]*$" />
<property name="applyToPrivate" value="false" />
</module>
<module name="TypeName">
<property name="format" value="^[A-Z][_a-zA-Z0-9]*$" />
</module>
<!-- Imports -->
<module name="AvoidStarImport">
<property name="allowStaticMemberImports" value="true" />
</module>
<module name="IllegalImport" />
<module name="ImportOrder">
<property name="option" value="top" />
<property name="groups" value="/^java\./,javax,org,com" />
<property name="separated" value="true" />
<property name="sortStaticImportsAlphabetically" value="true" />
<property name="useContainerOrderingForStatic" value="true" />
<metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit" />
</module>
<module name="RedundantImport" />
<module name="UnusedImports" />
<!-- Indentation -->
<module name="CommentsIndentation" />
<module name="Indentation">
<property name="basicOffset" value="3" />
<property name="caseIndent" value="3" />
<property name="throwsIndent" value="3" />
<property name="arrayInitIndent" value="3" />
<property name="lineWrappingIndentation" value="0" />
</module>
<!-- Size Violations -->
<module name="ParameterNumber">
<property name="ignoreOverriddenMethods" value="true" />
</module>
<!-- Whitespace -->
<module name="EmptyForInitializerPad" />
<module name="EmptyForIteratorPad" />
<module name="EmptyLineSeparator">
<property name="tokens" value="IMPORT,CLASS_DEF,ENUM_DEF,INTERFACE_DEF,CTOR_DEF,METHOD_DEF,STATIC_INIT,INSTANCE_INIT" />
</module>
<module name="GenericWhitespace" />
<module name="MethodParamPad" />
<module name="NoWhitespaceAfter">
<property name="severity" value="ignore" />
<metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit" />
</module>
<module name="NoWhitespaceBefore" />
<module name="NoWhitespaceBeforeCaseDefaultColon"/>
<module name="OperatorWrap">
<property name="tokens"
value="QUESTION,COLON,EQUAL,NOT_EQUAL,DIV,PLUS,MINUS,STAR,MOD,SR,BSR,GE,GT,SL,LE,LT,BXOR,BOR,LOR,BAND,LAND,LITERAL_INSTANCEOF,TYPE_EXTENSION_AND" />
</module>
<module name="ParenPad">
<metadata name="net.sf.eclipsecs.core.comment" value="TODO" />
<property name="severity" value="ignore" />
<metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit" />
</module>
<module name="SeparatorWrap">
<metadata name="net.sf.eclipsecs.core.comment" value="Dot on new line" />
<property name="option" value="nl" />
<property name="tokens" value="DOT" />
</module>
<module name="SeparatorWrap">
<metadata name="net.sf.eclipsecs.core.comment" value="Comma on end of line" />
<property name="tokens" value="COMMA" />
</module>
<module name="SingleSpaceSeparator" />
<module name="TypecastParenPad" />
<module name="WhitespaceAfter" />
<module name="WhitespaceAround">
<property name="allowEmptyConstructors" value="true" />
<property name="allowEmptyMethods" value="true" />
<property name="allowEmptyTypes" value="true" />
<property name="allowEmptyCatches" value="true" />
<property name="tokens"
value="ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,BXOR_ASSIGN,COLON,DIV,DIV_ASSIGN,DO_WHILE,EQUAL,GE,GT,LAMBDA,LAND,LCURLY,LE,LITERAL_ASSERT,LITERAL_CATCH,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,LITERAL_RETURN,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE,LOR,LT,MINUS,MINUS_ASSIGN,MOD,MOD_ASSIGN,NOT_EQUAL,PLUS,PLUS_ASSIGN,QUESTION,SL,SLIST,SL_ASSIGN,SR,SR_ASSIGN,STAR,STAR_ASSIGN,TYPE_EXTENSION_AND" />
</module>
<!-- Modifiers -->
<module name="ModifierOrder" />
<module name="RedundantModifier" />
<!-- Blocks -->
<module name="EmptyBlock">
<property name="option" value="text" />
</module>
<module name="EmptyCatchBlock" />
<module name="LeftCurly" />
<module name="RightCurly" />
<!-- Coding Problems -->
<module name="CovariantEquals" />
<module name="DefaultComesLast" />
<module name="EmptyStatement" />
<module name="EqualsAvoidNull" />
<module name="EqualsHashCode" />
<module name="FallThrough" />
<module name="FinalLocalVariable">
<property name="validateEnhancedForLoopVariable" value="true" />
<property name="tokens" value="PARAMETER_DEF,VARIABLE_DEF" />
</module>
<module name="IllegalCatch">
<property name="illegalClassNames" value="java.lang.Error, java.lang.Throwable" />
</module>
<module name="IllegalInstantiation" />
<module name="IllegalThrows" />
<!--
<module name="InnerAssignment" />
"final var button = this.button = new Button()" is needed to workaround Eclipse Null Analysis issues
-->
<module name="NoEnumTrailingComma"/>
<module name="NoFinalizer" />
<module name="OneStatementPerLine" />
<module name="PackageDeclaration" />
<module name="SimplifyBooleanReturn" />
<module name="SimplifyBooleanExpression" />
<module name="StringLiteralEquality" />
<module name="SuperFinalize" />
<module name="UnnecessaryParentheses" />
<module name="UnnecessarySemicolonAfterOuterTypeDeclaration" />
<module name="UnnecessarySemicolonAfterTypeMemberDeclaration" />
<module name="UnnecessarySemicolonInEnumeration" />
<module name="UnnecessarySemicolonInTryWithResources" />
<!-- Class Design -->
<module name="FinalClass" />
<module name="HideUtilityClassConstructor" />
<module name="MutableException" />
<module name="OneTopLevelClass" />
<!-- Miscellaneous -->
<module name="ArrayTypeStyle" />
<module name="AvoidEscapedUnicodeCharacters">
<property name="allowEscapesForControlCharacters" value="true" />
<property name="allowNonPrintableEscapes" value="true" />
<property name="allowIfAllCharactersEscaped" value="true" />
</module>
<module name="OuterTypeFilename" />
<module name="UpperEll" />
<!-- Filters -->
<module name="SuppressWithNearbyCommentFilter">
<metadata name="net.sf.eclipsecs.core.comment" value="Disable matching checkstyle rules for the following line" />
<property name="commentFormat" value="CHECKSTYLE:IGNORE ([^ ]+) FOR NEXT LINE" />
<property name="checkFormat" value="$1" />
<property name="influenceFormat" value="1" />
</module>
<module name="SuppressWithNearbyCommentFilter">
<metadata name="net.sf.eclipsecs.core.comment" value="Disable matching checkstyle rules for the following N lines" />
<property name="commentFormat" value="CHECKSTYLE:IGNORE ([^ ]+) FOR NEXT (\d+) LINES" />
<property name="checkFormat" value="$1" />
<property name="influenceFormat" value="$2" />
</module>
<module name="SuppressWithNearbyCommentFilter">
<metadata name="net.sf.eclipsecs.core.comment" value="Disable matching checkstyle rules on the same line" />
<property name="commentFormat" value="CHECKSTYLE:IGNORE ([^ ]+)" />
<property name="checkFormat" value="$1" />
</module>
<module name="SuppressWithNearbyCommentFilter">
<metadata name="net.sf.eclipsecs.core.comment" value="Disable switch fallthrough warning for the following line" />
<property name="commentFormat" value="\$FALL-THROUGH\$" />
<property name="checkFormat" value="FallThrough" />
<property name="influenceFormat" value="1" />
</module>
<!-- SevNTU rules https://github.com/sevntu-checkstyle/sevntu.checkstyle -->
<module name="AvoidConditionInversionCheck">
<property name="applyOnlyToRelationalOperands" value="true" />
</module>
<module name="AvoidConstantAsFirstOperandInConditionCheck">
<property name="targetConstantTypes" value="LITERAL_NULL,LITERAL_TRUE,LITERAL_FALSE,NUM_INT,NUM_DOUBLE,NUM_LONG,NUM_FLOAT" />
</module>
<module name="AvoidNotShortCircuitOperatorsForBooleanCheck" />
<module name="ConfusingConditionCheck" />
<module name="DiamondOperatorForVariableDefinitionCheck" />
<module name="EitherLogOrThrowCheck" />
<module name="EmptyPublicCtorInClassCheck" />
<module name="FinalizeImplementationCheck" />
<module name="ForbidInstantiationCheck" />
<module name="ForbidReturnInFinallyBlockCheck" />
<module name="ForbidThrowAnonymousExceptionsCheck" />
<module name="LogicConditionNeedOptimizationCheck" />
<module name="LineLengthExtendedCheck">
<property name="max" value="160" />
<property name="ignorePattern" value="^import .*$|^\s+(\*|//)\s.*https?:\/\/.+" />
</module>
<module name="MapIterationInForEachLoopCheck">
<property name="proposeKeySetUsage" value="true" />
<property name="proposeEntrySetUsage" value="true" />
</module>
<module name="MoveVariableInsideIfCheck" />
<module name="NameConventionForJunit4TestClassesCheck" />
<module name="NestedSwitchCheck">
<property name="max" value="2" />
</module>
<module name="NumericLiteralNeedsUnderscoreCheck" />
<module name="PublicReferenceToPrivateTypeCheck" />
<module name="RedundantReturnCheck" />
<module name="RequireFailForTryCatchInJunitCheck" />
<module name="ReturnNullInsteadOfBooleanCheck" />
<module name="UniformEnumConstantNameCheck" />
<module name="UnnecessaryParenthesesExtendedCheck" />
<module name="UselessSingleCatchCheck" />
<module name="UselessSuperCtorCallCheck" />
<module name="WhitespaceBeforeArrayInitializerCheck" />
</module>
<!-- Size Violations -->
<module name="LineLength">
<property name="fileExtensions" value="js, xml" />
<property name="max" value="160" />
</module>
<!-- Whitespace -->
<module name="FileTabCharacter">
<property name="fileExtensions" value="cfg, groovy, java, js, json, md, properties, py, sh, yml, yaml, xml, xsd" />
</module>
<!-- Miscellaneous -->
<module name="NewlineAtEndOfFile">
<property name="lineSeparator" value="lf_cr_crlf" />
<property name="fileExtensions" value="cfg, groovy, java, js, json, md, properties, py, sh, yml, yaml, xml, xsd" />
</module>
<module name="Translation" />
<module name="UniqueProperties" />
<!-- File Exclusion Filters -->
<module name="BeforeExecutionExclusionFileFilter">
<!-- https://github.com/checkstyle/checkstyle/issues/8240 -->
<metadata name="net.sf.eclipsecs.core.comment" value="Ignore module-info.java files which are currently not parseable by checkstyle" />
<property name="fileNamePattern" value="module\-info\.java$"/>
</module>
<module name="BeforeExecutionExclusionFileFilter">
<metadata name="net.sf.eclipsecs.core.comment" value="Ignore temp files generated by Eclipse markdown editor" />
<property name="fileNamePattern" value="\.md\.html$" />
</module>
<module name="BeforeExecutionExclusionFileFilter">
<metadata name="net.sf.eclipsecs.core.comment" value="Ignore certificate files" />
<property name="fileNamePattern" value="\.(pem|pfx|cer|crt)$" />
</module>
<module name="BeforeExecutionExclusionFileFilter">
<metadata name="net.sf.eclipsecs.core.comment" value="Ignore image files" />
<property name="fileNamePattern" value="\.(png|jpg|gif)$" />
</module>
<module name="BeforeExecutionExclusionFileFilter">
<metadata name="net.sf.eclipsecs.core.comment" value="Ignore node.js module cache directories" />
<property name="fileNamePattern" value="[\\/]node_modules[\\/].*$" />
</module>
<module name="BeforeExecutionExclusionFileFilter">
<metadata name="net.sf.eclipsecs.core.comment" value="Ignore auto-generated source files" />
<property name="fileNamePattern" value="[\\/]generated-sources[\\/].*$" />
</module>
</module>