forked from gomint/gomint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
checkstyle.xml
300 lines (256 loc) · 14.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
<?xml version="1.0"?>
<!--
~ Copyright (c) 2017, GoMint, BlackyPaw and geNAZt
~
~ This code is licensed under the BSD license found in the
~ LICENSE file in the root directory of this source tree.
-->
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.1//EN"
"http://www.puppycrawl.com/dtds/configuration_1_1.dtd">
<module name="Checker">
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value=" CHECKSTYLE:OFF"/>
<property name="onCommentFormat" value=" CHECKSTYLE:ON"/>
</module>
<module name="TreeWalker">
<!-- See http://checkstyle.sf.net/config_sizes.html !-->
<!-- Checks for long lines. !-->
<module name="LineLength">
<property name="ignorePattern" value="^$"/>
<property name="max" value="180"/>
</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="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="MethodLength">
<property name="max" value="100"/>
<property name="countEmpty" value="false"/>
<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="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="ParameterNumber">
<property name="max" value="10"/>
<property name="tokens" value="METHOD_DEF, CTOR_DEF"/>
</module>
<!-- Checks that the outer type name and the file name match. !-->
<!-- See http://checkstyle.sourceforge.net/config_misc.html#OuterTypeFilename !-->
<module name="OuterTypeFilename"/>
<!-- Checks for class type parameter name naming conventions. !-->
<!-- See http://checkstyle.sourceforge.net/config_naming.html#ClassTypeParameterName !-->
<module name="ClassTypeParameterName">
<property name="format" value="^[A-Z]$"/>
</module>
<!-- Checks for constant name naming conventions. !-->
<!-- See http://checkstyle.sf.net/config_naming.html !-->
<module name="ConstantName">
<property name="format" value="^logger|[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="LocalFinalVariableName">
<property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
<property name="tokens" value="VARIABLE_DEF"/>
</module>
<!-- Checks for local variable name naming conventions. !-->
<!-- See http://checkstyle.sf.net/config_naming.html !-->
<module name="LocalVariableName">
<property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
<property name="tokens" value="VARIABLE_DEF"/>
</module>
<!-- Checks for member variable name naming conventions. !-->
<!-- See http://checkstyle.sf.net/config_naming.html !-->
<module name="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="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="MethodTypeParameterName">
<property name="format" value="^[A-Z]$"/>
</module>
<!-- Checks for package name naming conventions. !-->
<!-- See http://checkstyle.sf.net/config_naming.html !-->
<module name="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="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="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="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>
<!-- Validates Javadoc comments to help ensure they are well formed. !-->
<!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocStyle !-->
<module name="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 Javadoc comments for class and interface definitions. !-->
<!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocType !-->
<module name="JavadocType">
<property name="scope" value="package"/>
<!--
<property name="excludeScope" value=""/>
!-->
<property name="authorFormat" value=""/>
<property name="versionFormat" value=""/>
<property name="allowMissingParamTags" value="false"/>
<property name="allowUnknownTags" value="false"/>
<property name="tokens" value="INTERFACE_DEF, CLASS_DEF"/>
</module>
<!-- Checks to ensure that the javadoc tags exist (if required) !-->
<!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocMethod !-->
<module name="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="JavadocVariable">
<property name="scope" value="package"/>
<!--
<property name="excludeScope" value=""/>
!-->
</module>
<!-- 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="ModifierOrder"/>
<!-- Checks that there are no redundant modifiers. !-->
<!-- See http://checkstyle.sf.net/config_modifiers.html !-->
<module name="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="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="InnerTypeLast"/>
<!-- Implements Bloch, Effective Java, Item 17 - Use Interfaces only to define types. !-->
<!-- See http://checkstyle.sf.net/config_design.html !-->
<module name="InterfaceIsType">
<property name="allowMarkerInterfaces" value="true"/>
</module>
<!-- Restricts throws statements to a specified count. !-->
<!-- See http://checkstyle.sf.net/config_design.html !-->
<module name="ThrowsCount">
<property name="max" value="3"/>
</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="CovariantEquals"/>
<!-- Checks declaration order according to Code Conventions for the Java Programming Language. !-->
<!-- See http://checkstyle.sf.net/config_coding.html !-->
<module name="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="DefaultComesLast"/>
<!-- Detects empty statements (standalone ;). !-->
<!-- See http://checkstyle.sf.net/config_coding.html !-->
<module name="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="IllegalCatch">
<property name="illegalClassNames" value="java.lang.Exception, 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="IllegalThrows">
<property name="illegalClassNames" value="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="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="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="ModifiedControlVariable"/>
<!-- Disallow assignment of parameters. !-->
<!-- See http://checkstyle.sf.net/config_coding.html !-->
<module name="ParameterAssignment"/>
<!-- this got moved here from the import checks !-->
<!-- Checks for unused import statements. !-->
<!-- See http://checkstyle.sf.net/config_import.html !-->
<module name="UnusedImports"/>
<module name="FileContentsHolder"/>
</module>
<!-- Checks that there are no tabs in the source file !-->
<!-- http://checkstyle.sourceforge.net/config_whitespace.html#FileTabCharacter !-->
<module name="FileTabCharacter"/>
</module>