-
Notifications
You must be signed in to change notification settings - Fork 2
/
checkstyle.xml
438 lines (357 loc) · 13.4 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
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
<?xml version="1.0" encoding="UTF-8"?>
<!--
The MIT License
Copyright 2013 Matthew.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<module name="Checker">
<!-- Checks that property files contain the same keys. -->
<module name="Translation"/>
<module name="TreeWalker">
<!-- Javadoc for class/interface must be present/valid. -->
<!-- Require author to be present. -->
<module name="JavadocType">
<property name="authorFormat" value="\S"/>
</module>
<!-- Javadoc for methods must be present/valid. -->
<module name="JavadocMethod">
<property name="allowUndeclaredRTE" value="true"/>
<property name="allowMissingPropertyJavadoc" value="true"/>
<property name="excludeScope" value="private"/>
</module>
<!-- Javadoc for class variables must be present/valid. -->
<module name="JavadocVariable">
<property name="excludeScope" value="private"/>
</module>
<!-- Javadoc must be well-formed. -->
<module name="JavadocStyle">
</module>
<!-- Naming conventions for packages. -->
<module name="PackageName">
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
</module>
<!-- Naming conventions for classes and interfaces. -->
<module name="TypeName"/>
<!-- Naming conventions for constants. -->
<!-- TODO: Problem with this is that it should cover basic -->
<!-- types only, and not names like instance_ and logger_ etc. -->
<!--
<module name="ConstantName"/>
-->
<!-- Naming conventions for class variables. -->
<module name="MemberName">
<property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
</module>
<!-- Naming conventions local variables. -->
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<module name="ParameterName"/>
<module name="StaticVariableName">
<property name="format" value="^[a-z][a-zA-Z0-9]*_$"/>
</module>
<!-- Avoid start imports -->
<module name="AvoidStarImport"/>
<!-- Avoid imports of the sun.* packages -->
<module name="IllegalImport"/>
<!-- Avoid redundant imports -->
<module name="RedundantImport"/>
<!-- Avoid unused imports -->
<module name="UnusedImports"/>
<!-- Ensure certian import order -->
<module name="ImportOrder">
<property name="groups" value="java,javax"/>
<property name="ordered" value="true"/>
<property name="separated" value="true"/>
</module>
<!-- Lines should be maximum of 120 characters -->
<module name="LineLength">
<property name="max" value="120"/>
</module>
<!-- -->
<module name="MethodParamPad"/>
<!-- No whitespace after selected tokens -->
<module name="NoWhitespaceAfter"/>
<!-- -->
<module name="NoWhitespaceBefore"/>
<!-- -->
<module name="OperatorWrap">
<property name="tokens" value="ASSIGN,
BAND,
BAND_ASSIGN,
BOR,
BOR_ASSIGN,
BSR,
BSR_ASSIGN,
BXOR,
BXOR_ASSIGN,
COLON,
DIV,
DIV_ASSIGN,
EQUAL,
GE,
GT,
LAND,
LE,
LITERAL_INSTANCEOF,
LOR,
LT,
MINUS,
MINUS_ASSIGN,
MOD,
MOD_ASSIGN,
NOT_EQUAL,
QUESTION,
SL,
SL_ASSIGN,
SR,
SR_ASSIGN,
STAR,
STAR_ASSIGN"/>
<property name="option" value="eol"/>
</module>
<!-- -->
<module name="ParenPad"/>
<!-- No space in a case oparation "(int)" not "( int )" -->
<module name="TypecastParenPad">
<property name="option" value="nospace"/>
</module>
<!-- Space after comma, semicolon and casts -->
<module name="WhitespaceAfter">
<property name="tokens" value="COMMA,
SEMI,
TYPECAST"/>
</module>
<!-- Ensure whitespace around all operators other than -->
<!-- GENERIC_START and GENERIC_END -->
<module name="WhitespaceAround">
<property name="tokens" value="ASSIGN,
BAND,
BAND_ASSIGN,
BOR,
BOR_ASSIGN,
BSR,
BSR_ASSIGN,
BXOR,
BXOR_ASSIGN,
COLON,
DIV,
DIV_ASSIGN,
EQUAL,
GE,
GT,
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,
RCURLY,
SL,
SLIST,
SL_ASSIGN,
SR,
SR_ASSIGN,
STAR,
STAR_ASSIGN,
TYPE_EXTENSION_AND,
WILDCARD_TYPE"/>
</module>
<!-- Check modifier order: -->
<!-- public | protected | private -->
<!-- abstract -->
<!-- static -->
<!-- final -->
<!-- transient | volatile -->
<!-- synchronized -->
<!-- native -->
<!-- strictfp -->
<module name="ModifierOrder"/>
<!-- Avoid redundant modifiers -->
<module name="RedundantModifier"/>
<!-- Avoid empty blocks -->
<module name="EmptyBlock"/>
<!-- Classes, interfaces and methods have left brace on a new line -->
<module name="LeftCurly">
<property name="option" value="eol"/>
<property name="maxLineLength" value="120"/>
<property name="tokens" value="CLASS_DEF,
CTOR_DEF,
INTERFACE_DEF,
METHOD_DEF"/>
</module>
<!-- The others have left brace at eol -->
<module name="LeftCurly">
<property name="option" value="eol"/>
<property name="maxLineLength" value="120"/>
<property name="tokens" value="LITERAL_CATCH,
LITERAL_DO,
LITERAL_ELSE,
LITERAL_FINALLY,
LITERAL_FOR,
LITERAL_IF,
LITERAL_SWITCH,
LITERAL_SYNCHRONIZED,
LITERAL_TRY,
LITERAL_WHILE"/>
</module>
<!-- TODO -->
<module name="RightCurly">
<property name="option" value="alone"/>
<property name="tokens" value="LITERAL_CATCH,
LITERAL_FINALLY,
LITERAL_ELSE"/>
</module>
<!-- Avoid nested blocks other than in switch statements -->
<module name="AvoidNestedBlocks">
<property name="allowInSwitchCase" value="true"/>
</module>
<!-- Checks that classes that define a covariant equals() method -->
<!-- also override method equals(java.lang.Object) -->
<module name="CovariantEquals"/>
<!-- Avoid empty statements -->
<!-- TODO: Should be alloed in empty for-loop -->
<module name="EmptyStatement"/>
<!-- Checks that classes that override equals() -->
<!-- also override hashCode() -->
<module name="EqualsHashCode"/>
<!-- Checks that local variables and parameters that are never -->
<!-- are declared final -->
<module name="FinalLocalVariable">
<property name="tokens" value="PARAMETER_DEF,
VARIABLE_DEF"/>
</module>
<!-- Check that method/constructor/catch block parameters are final -->
<!--
<module name="FinalParameters"/>
-->
<!-- Check that a name doens't hide another name -->
<module name="HiddenField">
<property name="ignoreSetter" value="true"/>
</module>
<!-- TODO
<module name="IllegalTokenText">
<property name="tokens" value="NUM_FLOAT,NUM_DOUBLE"/>
</module>
-->
<!-- Avoid inner assignments -->
<module name="InnerAssignment"/>
<!-- Require default clause in switch statements -->
<module name="MissingSwitchDefault"/>
<!-- Avoid modifying control variables -->
<module name="ModifiedControlVariable"/>
<!-- Avoid redundant throws -->
<module name="RedundantThrows">
<property name="allowUnchecked" value="true"/>
</module>
<!-- Require simple boolean expressions -->
<module name="SimplifyBooleanExpression"/>
<!-- Require simple boolean expressions -->
<module name="SimplifyBooleanReturn"/>
<!-- Capture string compare using == -->
<module name="StringLiteralEquality"/>
<!-- Checks that an overriding clone() method invokes super.clone() -->
<module name="SuperClone"/>
<!-- Checks that an overriding finalize() method invokes -->
<!-- super.finalize() -->
<module name="SuperFinalize"/>
<!-- Disallow catcing exception base classes -->
<module name="IllegalCatch"/>
<!-- Disallow throwing exception base classes -->
<module name="IllegalThrows"/>
<!-- Require all classes to be in a package -->
<module name="PackageDeclaration"/>
<!-- Ensures correct layout of JUnit test cases -->
<module name="JUnitTestCase"/>
<!-- Enforce the following declaration order: -->
<!-- 1. Class variables -->
<!-- 2. Instance variables -->
<!-- 3. Ctors -->
<!-- 4. Methods -->
<module name="DeclarationOrder"/>
<!-- Disallow parameter assignment -->
<module name="ParameterAssignment"/>
<!-- Avoid explicit initialization to the default value -->
<module name="ExplicitInitialization"/>
<!-- Ensure the default clasue is the last case in a switch -->
<module name="DefaultComesLast"/>
<!-- Disallow non-commented swicth fall throug -->
<module name="FallThrough"/>
<!-- Each variable should be declared individually -->
<module name="MultipleVariableDeclarations"/>
<!-- Avoid unnecessary parantheses -->
<module name="UnnecessaryParentheses"/>
<!-- Make sure only static finals are public -->
<module name="VisibilityModifier">
<property name="protectedAllowed" value="true"/>
</module>
<!-- Class with private constructor must be final -->
<module name="FinalClass"/>
<!-- Utility classes should have private ctor -->
<module name="HideUtilityClassConstructor"/>
<!-- Ensures that exception classes are immutable -->
<module name="MutableException"/>
<!-- Flag overly complex constructions -->
<module name="ClassFanOutComplexity">
<property name="max" value="21"/>
</module>
<module name="CyclomaticComplexity">
<property name="max" value="20"/>
</module>
<module name="NPathComplexity">
<property name="max" value="260"/>
</module>
<!-- Identify TODOs -->
<module name="TodoComment">
<property name="format" value="TODO"/>
</module>
<!-- Flag uncommented main() methods (debugging left-overs) -->
<module name="UncommentedMain"/>
<!-- Require long constants to be defined by uppercase L -->
<module name="UpperEll"/>
<!-- Array brackets on type not varaible -->
<module name="ArrayTypeStyle"/>
<!-- Indentations -->
<module name="Indentation">
<property name="basicOffset" value="4"/>
<property name="braceAdjustment" value="0"/>
<property name="caseIndent" value="8"/>
</module>
<!-- Avoid trailing comments -->
<module name="TrailingComment"/>
</module>
</module>