forked from viper-pse/viper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
checkstyle.xml
386 lines (326 loc) · 22.1 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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.1//EN" "http://www.puppycrawl.com/dtds/configuration_1_1.dtd">
<module name="Checker">
<!-- ######## TEMPLATE/CHECKSTYLE/SIZE.XML ######## !-->
<!-- See http://checkstyle.sourceforge.net/config_sizes.html#FileLength !-->
<!-- Checks for long files. !-->
<module name="com.puppycrawl.tools.checkstyle.checks.sizes.FileLength">
<property name="max" value="650"/>
<property name="fileExtensions" value=""/>
</module>
<module name="com.puppycrawl.tools.checkstyle.TreeWalker">
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.NeedBraces" />
<!-- See http://checkstyle.sf.net/config_sizes.html !-->
<!-- Checks for long lines. !-->
<module name="com.puppycrawl.tools.checkstyle.checks.sizes.LineLength">
<property name="ignorePattern" value="^$"/>
<property name="max" value="120"/>
</module>
<!-- Checks the number of methods declared in each type. This includes the number of each scope !-->
<!-- (private, package, protected and public) as well as an overall total. !-->
<!-- See http://checkstyle.sourceforge.net/config_sizes.html#MethodCount !-->
<module name="com.puppycrawl.tools.checkstyle.checks.sizes.MethodCount">
<property name="maxTotal" value="100"/>
<property name="maxPrivate" value="100"/>
<property name="maxPackage" value="100"/>
<property name="maxProtected" value="100"/>
<property name="maxPublic" value="100"/>
</module>
<!-- Checks for long methods and constructors. !-->
<!-- See http://checkstyle.sf.net/config_sizes.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.sizes.MethodLength">
<property name="max" value="80"/>
<property name="countEmpty" value="true"/>
<property name="tokens" value="METHOD_DEF, CTOR_DEF"/>
</module>
<!-- Checks for the number of types declared at the outer (or root) level in a file. !-->
<!-- See http://checkstyle.sourceforge.net/config_sizes.html#OuterTypeNumber !-->
<module name="com.puppycrawl.tools.checkstyle.checks.sizes.OuterTypeNumber">
<property name="max" value="1"/>
</module>
<!-- Checks the number of parameters of a method or constructor. !-->
<!-- See http://checkstyle.sf.net/config_sizes.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.sizes.ParameterNumber">
<property name="max" value="9"/>
<property name="tokens" value="METHOD_DEF, CTOR_DEF"/>
</module>
</module>
<!-- ######## END OF TEMPLATE/CHECKSTYLE/SIZE.XML ######## !-->
<!-- ######## TEMPLATE/CHECKSTYLE/WHITESPACE.XML ######## !-->
<module name="com.puppycrawl.tools.checkstyle.TreeWalker">
<!-- Checks the padding of an empty for initializer. !-->
<!-- See http://checkstyle.sf.net/config_whitespace.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForInitializerPad">
<property name="option" value="nospace"/>
</module>
<!-- Checks the padding of an empty for iterator. !-->
<!-- See http://checkstyle.sf.net/config_whitespace.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForIteratorPad">
<property name="option" value="nospace"/>
</module>
<!-- Checks that the whitespace around the Generic tokens < and > is correct to the typical convention. !-->
<!-- See http://checkstyle.sourceforge.net/config_whitespace.html#GenericWhitespace !-->
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.GenericWhitespace"/>
<!-- Checks the padding between the identifier of a method definition, !-->
<!-- constructor definition, method call, or constructor invocation; and the left parenthesis of the parameter list. !-->
<!-- See http://checkstyle.sf.net/config_whitespace.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPad">
<property name="allowLineBreaks" value="false"/>
<property name="option" value="nospace"/>
<property name="tokens" value="CTOR_DEF, LITERAL_NEW, METHOD_CALL, METHOD_DEF, SUPER_CTOR_CALL "/>
</module>
<!-- Checks that there is no whitespace after a token. !-->
<!-- See http://checkstyle.sf.net/config_whitespace.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfter">
<property name="allowLineBreaks" value="true"/>
<property name="tokens" value="ARRAY_INIT, BNOT, DEC, DOT, INC, LNOT, UNARY_MINUS, UNARY_PLUS"/>
</module>
<!-- Checks that there is no whitespace before a token. !-->
<!-- See http://checkstyle.sf.net/config_whitespace.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBefore">
<property name="allowLineBreaks" value="false"/>
<property name="tokens" value="SEMI, POST_DEC, POST_INC"/>
</module>
<!-- Checks the policy on how to wrap lines on operators. !-->
<!-- See http://checkstyle.sf.net/config_whitespace.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrap">
<property name="option" value="nl"/>
<property name="tokens" value="ASSIGN, BAND, BOR, BSR, BXOR, COLON, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR"/>
</module>
<!-- Checks the policy on the padding of parentheses. !-->
<!-- See http://checkstyle.sf.net/config_whitespace.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPad">
<property name="option" value="nospace"/>
<property name="tokens" value="CTOR_CALL, METHOD_CALL, SUPER_CTOR_CALL"/>
</module>
<!-- Checks the policy on the padding of parentheses for typecasts. !-->
<!-- See http://checkstyle.sf.net/config_whitespace.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.TypecastParenPad">
<property name="option" value="nospace"/>
<property name="tokens" value="TYPECAST, RPAREN"/>
</module>
<!-- Checks that a token is followed by whitespace. !-->
<!-- See http://checkstyle.sf.net/config_whitespace.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfter">
<property name="tokens" value="COMMA, SEMI, TYPECAST"/>
</module>
<!-- Checks that a token is surrounded by whitespace. !-->
<!-- See http://checkstyle.sf.net/config_whitespace.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.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"/>
<property name="allowEmptyConstructors" value="false"/>
<property name="allowEmptyMethods" value="false"/>
</module>
<!-- The following checks are actually not whitespace checks, but still fit here quite well. !-->
<!-- Checks that there is only one statement per line. !-->
<!-- See http://checkstyle.sourceforge.net/config_coding.html#OneStatementPerLine !-->
<module name="com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLine"/>
<!-- Checks that each variable declaration is in its own statement and on its own line. !-->
<!-- See http://checkstyle.sf.net/config_coding.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.coding.MultipleVariableDeclarations"/>
<module name="com.puppycrawl.tools.checkstyle.checks.coding.RequireThis">
<property name="validateOnlyOverlapping" value="false"/>
</module>
</module>
<!-- Checks that there are no tabs in the source file !-->
<!-- http://checkstyle.sourceforge.net/config_whitespace.html#FileTabCharacter !-->
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.FileTabCharacter"/>
<!-- ######## END OF TEMPLATE/CHECKSTYLE/WHITESPACE.XML ######## !-->
<!-- ######## TEMPLATE/CHECKSTYLE/NAMING.XML ######## !-->
<module name="com.puppycrawl.tools.checkstyle.TreeWalker">
<!-- Checks that the outer type name and the file name match. !-->
<!-- See http://checkstyle.sourceforge.net/config_misc.html#OuterTypeFilename !-->
<module name="com.puppycrawl.tools.checkstyle.checks.OuterTypeFilename"/>
<!-- Checks for class type parameter name naming conventions. !-->
<!-- See http://checkstyle.sourceforge.net/config_naming.html#ClassTypeParameterName !-->
<module name="com.puppycrawl.tools.checkstyle.checks.naming.ClassTypeParameterName">
<property name="format" value="^[A-Z]$"/>
</module>
<!-- Checks for constant name naming conventions. !-->
<!-- See http://checkstyle.sf.net/config_naming.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.naming.ConstantName">
<property name="format" value="^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>
<property name="applyToPublic" value="true"/>
<property name="applyToProtected" value="true"/>
<property name="applyToPackage" value="true"/>
<property name="applyToPrivate" value="true"/>
</module>
<!-- Checks for local final variable name naming conventions. !-->
<!-- See http://checkstyle.sf.net/config_naming.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.naming.LocalFinalVariableName">
<property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
<property name="tokens" value="VARIABLE_DEF, PARAMETER_DEF"/>
</module>
<!-- Checks for local variable name naming conventions. !-->
<!-- See http://checkstyle.sf.net/config_naming.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.naming.LocalVariableName">
<property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
<!--<property name="tokens" value="VARIABLE_DEF, PARAMETER_DEF"/>-->
</module>
<!-- Checks for member variable name naming conventions. !-->
<!-- See http://checkstyle.sf.net/config_naming.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.naming.MemberName">
<property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
<property name="applyToPublic" value="true"/>
<property name="applyToProtected" value="true"/>
<property name="applyToPackage" value="true"/>
<property name="applyToPrivate" value="true"/>
</module>
<!-- Checks for method name naming conventions. !-->
<!-- See http://checkstyle.sf.net/config_naming.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.naming.MethodName">
<property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
</module>
<!-- Checks for method type parameter name naming conventions. !-->
<!-- See http://checkstyle.sourceforge.net/config_naming.html#MethodTypeParameterName !-->
<module name="com.puppycrawl.tools.checkstyle.checks.naming.MethodTypeParameterName">
<property name="format" value="^[A-Z]$"/>
</module>
<!-- Checks for package name naming conventions. !-->
<!-- See http://checkstyle.sf.net/config_naming.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.naming.PackageName">
<property name="format" value="^[a-z]+(\.[a-zA-Z_][a-zA-Z0-9_]*)*$"/>
</module>
<!-- Checks for parameter name naming conventions. !-->
<!-- See http://checkstyle.sf.net/config_naming.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.naming.ParameterName">
<property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
</module>
<!-- Checks for static variable name naming conventions. !-->
<!-- See http://checkstyle.sf.net/config_naming.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.naming.StaticVariableName">
<property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
<property name="applyToPublic" value="true"/>
<property name="applyToProtected" value="true"/>
<property name="applyToPackage" value="true"/>
<property name="applyToPrivate" value="true"/>
</module>
<!-- Checks for type name naming conventions. !-->
<!-- See http://checkstyle.sf.net/config_naming.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.naming.TypeName">
<property name="format" value="^[A-Z][a-zA-Z0-9]*$"/>
<property name="tokens" value="CLASS_DEF, INTERFACE_DEF"/>
<property name="applyToPublic" value="true"/>
<property name="applyToProtected" value="true"/>
<property name="applyToPackage" value="true"/>
<property name="applyToPrivate" value="true"/>
</module>
</module>
<!-- ######## END OF TEMPLATE/CHECKSTYLE/NAMING.XML ######## !-->
<!-- ######## TEMPLATE/CHECKSTYLE/JAVADOC.XML ######## !-->
<module name="com.puppycrawl.tools.checkstyle.TreeWalker">
<!-- Validates Javadoc comments to help ensure they are well formed. !-->
<!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocStyle !-->
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyle">
<property name="scope" value="private"/>
<!--
<property name="excludeScope" value=""/>
!-->
<property name="checkFirstSentence" value="false"/>
<property name="endOfSentenceFormat" value="([.?!][ \t\n\r\f<])|([.?!]$)"/>
<property name="checkEmptyJavadoc" value="false"/>
<property name="checkHtml" value="true"/>
<property name="tokens" value="INTERFACE_DEF, CLASS_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
</module>
<!-- Checks to ensure that the javadoc tags exist (if required) !-->
<!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocMethod !-->
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethod">
<property name="scope" value="package"/>
<!--
<property name="excludeScope" value=""/>
!-->
<property name="allowUndeclaredRTE" value="false"/>
<property name="allowThrowsTagsForSubclasses" value="false"/>
<property name="allowMissingParamTags" value="false"/>
<property name="allowMissingThrowsTags" value="false"/>
<property name="allowMissingReturnTag" value="false"/>
<property name="allowMissingJavadoc" value="false"/>
<property name="allowMissingPropertyJavadoc" value="false"/>
<property name="logLoadErrors" value="true"/>
<property name="suppressLoadErrors" value="false"/>
<property name="tokens" value="METHOD_DEF, CTOR_DEF"/>
</module>
<!-- Checks that variables have Javadoc comments. !-->
<!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocVariable !-->
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocVariable">
<property name="scope" value="package"/>
<!--
<property name="excludeScope" value=""/>
!-->
</module>
</module>
<!-- ######## END OF TEMPLATE/CHECKSTYLE/JAVADOC.XML ######## !-->
<!-- ######## TEMPLATE/CHECKSTYLE/OTHERS.XML ######## !-->
<module name="com.puppycrawl.tools.checkstyle.TreeWalker">
<!-- Checks that the order of modifiers conforms to the suggestions in the Java Language specification, !-->
<!-- sections 8.1.1, 8.3.1 and 8.4.3. !-->
<!-- See http://checkstyle.sf.net/config_modifiers.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.modifier.ModifierOrder"/>
<!-- Checks that there are no redundant modifiers. !-->
<!-- See http://checkstyle.sf.net/config_modifiers.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.modifier.RedundantModifier">
<property name="tokens" value="METHOD_DEF, VARIABLE_DEF, ANNOTATION_FIELD_DEF"/>
</module>
<!-- Checks that a class which has only private constructors is declared as final. !-->
<!-- See http://checkstyle.sf.net/config_design.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.design.FinalClass"/>
<!-- Check nested (internal) classes/interfaces are declared at the bottom of the class after all method and field declarations. !-->
<!-- See http://checkstyle.sourceforge.net/config_design.html#InnerTypeLast !-->
<module name="com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLast"/>
<!-- Implements Bloch, Effective Java, Item 17 - Use Interfaces only to define types. !-->
<!-- See http://checkstyle.sf.net/config_design.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.design.InterfaceIsType">
<property name="allowMarkerInterfaces" value="false"/>
</module>
<!-- Restricts throws statements to a specified count. !-->
<!-- See http://checkstyle.sf.net/config_design.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.design.ThrowsCount">
<property name="max" value="2"/>
</module>
<!-- Checks that classes that define a covariant equals() method also override method equals(java.lang.Object). !-->
<!-- See http://checkstyle.sf.net/config_coding.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.coding.CovariantEquals"/>
<!-- Checks declaration order according to Code Conventions for the Java Programming Language. !-->
<!-- See http://checkstyle.sf.net/config_coding.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.coding.DeclarationOrder">
<property name="ignoreConstructors" value="false"/>
<property name="ignoreModifiers" value="false"/>
</module>
<!-- Check that the default is after all the cases in a switch statement. !-->
<!-- See http://checkstyle.sf.net/config_coding.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.coding.DefaultComesLast"/>
<!-- Detects empty statements (standalone ;). !-->
<!-- See http://checkstyle.sf.net/config_coding.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.coding.EmptyStatement"/>
<!-- Catching java.lang.Exception, java.lang.Error or java.lang.RuntimeException is almost never acceptable. !-->
<!-- See http://checkstyle.sf.net/config_coding.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.coding.IllegalCatch">
<property name="illegalClassNames" value="java.lang.Exception, java.lang.Throwable, java.lang.RuntimeException"/>
</module>
<!-- This check can be used to ensure that types are not declared to be thrown. !-->
<!-- Declaring to throw java.lang.Error or java.lang.RuntimeException is almost never acceptable. !-->
<!-- See http://checkstyle.sourceforge.net/config_coding.html#IllegalThrows !-->
<module name="com.puppycrawl.tools.checkstyle.checks.coding.IllegalThrows">
<property name="illegalClassNames" value="java.lang.Throwable, java.lang.Error, java.lang.RuntimeException"/>
</module>
<!-- Checks for assignments in subexpressions, such as in String s = Integer.toString(i = 2);. !-->
<!-- See http://checkstyle.sf.net/config_coding.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.coding.InnerAssignment">
<property name="tokens" value="ASSIGN, BAND_ASSIGN, BOR_ASSIGN, BSR_ASSIGN, BXOR_ASSIGN, DIV_ASSIGN, MINUS_ASSIGN, MOD_ASSIGN, PLUS_ASSIGN, SL_ASSIGN, SR_ASSIGN, STAR_ASSIGN"/>
</module>
<!-- Checks that switch statement has "default" clause. !-->
<!-- See http://checkstyle.sf.net/config_coding.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.coding.MissingSwitchDefault"/>
<!-- Check for ensuring that for loop control variables are not modified inside the for block. !-->
<!-- See http://checkstyle.sourceforge.net/config_coding.html#ModifiedControlVariable !-->
<module name="com.puppycrawl.tools.checkstyle.checks.coding.ModifiedControlVariable"/>
<!-- Disallow assignment of parameters. !-->
<!-- See http://checkstyle.sf.net/config_coding.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.coding.ParameterAssignment"/>
<!-- this got moved here from the import checks !-->
<!-- Checks for unused import statements. !-->
<!-- See http://checkstyle.sf.net/config_import.html !-->
<module name="com.puppycrawl.tools.checkstyle.checks.imports.UnusedImports"/>
</module>
<!-- ######## END OF TEMPLATE/CHECKSTYLE/OTHERS.XML ######## !-->
</module>