-
Notifications
You must be signed in to change notification settings - Fork 0
/
checkstyle.xml
330 lines (320 loc) · 15.5 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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<!--
This configuration file was written by the eclipse-cs plugin configuration editor
-->
<module name="Checker">
<module name="SuppressWithNearbyCommentFilter">
<property name="commentFormat" value="CHECKSTYLE DISABLE ([\w\|]+) FOR (-?\d+) LINES"/>
<property name="checkFormat" value="$1"/>
<property name="influenceFormat" value="$2"/>
</module>
<module name="UniqueProperties">
<!-- Checks properties files for duplicated properties.-->
<property name="severity" value="error"/>
</module>
<module name="FileTabCharacter">
<!-- Checks that there are no tab characters ('\t') in the source code-->
<property name="eachLine" value="true"/>
<property name="severity" value="error"/>
</module>
<module name="Translation">
<!-- Ensures the correct translation of code by checking property files for consistency regarding their keys-->
<property name="severity" value="error"/>
</module>
<property name="severity" value="error"/>
<!-- Filter out Checkstyle warnings that have been suppressed with the @SuppressWarnings annotation -->
<module name="SuppressWarningsFilter"/>
<module name="TreeWalker">
<module name="RedundantImport">
<!-- Checks for redundant import statements. -->
<property name="severity" value="error"/>
</module>
<module name="IllegalImport">
<!-- Checks for illegal import statements (sun.* packages - not guaranteed to work on all Java-compatible platforms). -->
<property name="severity" value="error"/>
</module>
<module name="UnusedImports">
<!-- Checks for unused import statements. -->
<property name="severity" value="error"/>
</module>
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
<module name="JavadocMethod">
<property name="excludeScope" value="private"/>
<property name="minLineCount" value="2"/>
<property name="allowMissingPropertyJavadoc" value="true"/>
<property name="tokens" value="METHOD_DEF,ANNOTATION_FIELD_DEF"/>
</module>
<module name="JavadocType">
<property name="scope" value="public"/>
</module>
<module name="JavadocStyle"/>
<!-- See http://checkstyle.sf.net/config_naming.html -->
<module name="LocalFinalVariableName"/>
<module name="PackageName"/>
<module name="ParameterName"/>
<module name="StaticVariableName"/>
<module name="TypeName"/>
<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<module name="MethodLength"/>
<module name="ParameterNumber"/>
<!-- Checks for blocks. -->
<!-- See http://checkstyle.sf.net/config_blocks.html -->
<!-- Checks for the placement of left curly braces ('{') for code blocks -->
<module name="LeftCurly"/>
<!-- Checks for braces around code blocks -->
<module name="NeedBraces"/>
<!-- Checks the placement of right curly braces ('}') for if-else, try-catch-finally blocks, while-loops, for-loops, method definitions, class definitions, constructor definitions, instance and static initialization blocks -->
<module name="RightCurly"/>
<!-- Checks that long constants are defined with an upper ell.-->
<module name="UpperEll"/>
<!-- Checks that there is only one statement per line. -->
<module name="OneStatementPerLine"/>
<!-- Checks that overload methods are grouped together -->
<module name="OverloadMethodsDeclarationOrder"/>
<!-- Checks that classes that override equals() also override hashCode() -->
<module name="EqualsHashCode"/>
<!-- Avoid inner assignments -->
<module name="InnerAssignment"/>
<!-- Require default clause in switch statements -->
<module name="MissingSwitchDefault"/>
<!-- Ensure the default clause is the last case in a switch -->
<module name="DefaultComesLast"/>
<!-- Avoid modifying control variables -->
<module name="ModifiedControlVariable"/>
<!-- 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 catching exception base classes -->
<module name="IllegalCatch"/>
<!-- Require all classes to be in a package -->
<module name="PackageDeclaration"/>
<!-- 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"/>
<!-- Disallow non-commented switch fall through -->
<module name="FallThrough">
<!-- Warn about falling through to the next case statement. Similar to
javac -Xlint:fallthrough, but the check is suppressed if a single-line comment
on the last non-blank line preceding the fallen-into case contains 'fall through' (or
some other variants which we don't publicized to promote consistency).
-->
<property name="reliefPattern"
value="fall through|Fall through|fallthru|Fallthru|falls through|Falls through|fallthrough|Fallthrough|No break|NO break|no break|continue on"/>
<property name="severity" value="error"/>
</module>
<!-- Magic number would not consider zero (0) as this is used for initialization on cycles. -->
<module name="MagicNumber">
<property name="tokens" value="NUM_DOUBLE, NUM_FLOAT"/>
<property name="ignoreNumbers" value="0"/>
<property name="severity" value="warning"/>
</module>
<!-- Checks for multiple occurrences of the same string literal within a single file -->
<module name="MultipleStringLiterals">
<property name="allowedDuplicates" value="3"/>
<property name="severity" value="warning"/>
</module>
<!-- Checks that each variable declaration is in its own statement and on its own line. -->
<module name="MultipleVariableDeclarations"/>
<!-- Checks for the use of unnecessary parentheses -->
<module name="UnnecessaryParentheses"/>
<!-- Checks for class design -->
<!-- Checks that a class which has only private constructors is declared as final -->
<module name="FinalClass"/>
<!-- Makes sure that utility classes (classes that contain only static methods or fields in their API) do not have a public constructor. -->
<module name="HideUtilityClassConstructor"/>
<!-- Checks visibility of class members to enforce encapsulation. -->
<module name="VisibilityModifier"/>
<!-- Flag overly complex constructions -->
<module name="ClassFanOutComplexity">
<property name="severity" value="error"/>
</module>
<module name="NPathComplexity">
<property name="severity" value="warning"/>
</module>
<!-- Identify TODOs -->
<module name="TodoComment">
<property name="format" value="(TODO|HACK|FIXME)"/>
<property name="severity" value="info"/>
</module>
<!-- Array brackets on type not variable - String[] args not String args[] -->
<module name="ArrayTypeStyle">
<property name="severity" value="error"/>
</module>
<!-- Check that parameters for methods, constructors, and catch blocks are final.-->
<module name="FinalParameters">
<property name="severity" value="error"/>
</module>
<module name="ModifierOrder">
<!-- Warn if modifier order is inconsistent with JLS3 8.1.1, 8.3.1, and
8.4.3. The prescribed order is:
public, protected, private, abstract, static, final, transient, volatile,
synchronized, native, strictfp
-->
<property name="severity" value="error"/>
</module>
<!-- Checks for redundant modifiers -->
<module name="RedundantModifier">
<property name="severity" value="error"/>
</module>
<!-- Checks that local variables that never have their values changed are declared final -->
<module name="FinalLocalVariable">
<property name="tokens" value="VARIABLE_DEF,PARAMETER_DEF"/>
<property name="severity" value="warning"/>
</module>
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<module name="EmptyForIteratorPad"/>
<module name="GenericWhitespace"/>
<module name="MethodParamPad"/>
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"/>
<module name="ParenPad"/>
<module name="TypecastParenPad"/>
<module name="WhitespaceAfter"/>
<module name="WhitespaceAround"/>
<module name="FileContentsHolder"/>
<module name="AvoidNestedBlocks">
<property name="severity" value="error"/>
</module>
<module name="EmptyBlock">
<property name="severity" value="error"/>
</module>
<module name="CovariantEquals">
<property name="severity" value="error"/>
</module>
<module name="EmptyStatement">
<property name="severity" value="error"/>
</module>
<module name="IllegalInstantiation">
<property name="severity" value="error"/>
<property name="classes" value="Boolean"/>
</module>
<module name="IllegalThrows">
<property name="severity" value="error"/>
</module>
<module name="NestedIfDepth">
<property name="severity" value="error"/>
<property name="max" value="2"/>
</module>
<module name="NestedTryDepth">
<property name="severity" value="error"/>
<property name="max" value="2"/>
</module>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<module name="StringLiteralEquality"/>
<module name="HideUtilityClassConstructor"/>
<module name="MutableException">
<property name="severity" value="error"/>
</module>
<module name="CyclomaticComplexity"/>
<module name="ReturnCount">
<property name="severity" value="error"/>
<property name="max" value="5"/>
</module>
<module name="ThrowsCount">
<property name="severity" value="warning"/>
<property name="max" value="4"/>
</module>
<module name="MethodLength">
<property name="max" value="100"/>
</module>
<module name="MethodLength">
<property name="severity" value="warning"/>
<property name="max" value="170"/>
</module>
<module name="BooleanExpressionComplexity">
<property name="severity" value="warning"/>
<property name="max" value="3"/>
</module>
<module name="LineLength">
<property name="severity" value="ignore"/>
<property name="max" value="120"/>
<property name="tabWidth" value="3"/>
<metadata name="com.atlassw.tools.eclipse.checkstyle.lastEnabledSeverity" value="error"/>
<metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
</module>
<module name="ParameterNumber">
<property name="severity" value="warning"/>
<property name="max" value="6"/>
</module>
<module name="ParameterNumber">
<property name="severity" value="error"/>
<property name="tokens" value="CTOR_DEF,METHOD_DEF"/>
</module>
<module name="AbstractClassName">
<property name="ignoreModifier" value="false"/>
<property name="ignoreName" value="true"/>
<property name="format" value="^Abstract.*$"/>
</module>
<!-- Produces lots of errors in generated ViewConstants files
<module name="ConstantName">
<property name="severity" value="ignore"/>
<metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
</module>
-->
<module name="LocalVariableName">
<property name="format" value="^[a-z][a-zA-Z0-9_]*$"/>
</module>
<module name="MemberName">
<property name="format" value="^[a-z][a-zA-Z0-9_]*$"/>
</module>
<module name="MethodName">
<property name="severity" value="error"/>
<property name="format" value="^[a-z][a-zA-Z0-9_]*$"/>
</module>
<!-- We don't use a DateHelper
<module name="Regexp">
<property name="severity" value="error"/>
<property name="format" value="=\s*(DateUtil.*|DateUtils.*|new Date.*|Calendar.*|FastDateFormat.*|SimpleDateFormat.*)"/>
<property name="message" value="You tried to assign a Date without using DateHelper!"/>
<property name="illegalPattern" value="true"/>
</module>
-->
<module name="Regexp">
<property name="format" value="@Hidden.*[\n]?.*public[ ]*void[ ]*set"/>
<property name="message"
value="@Hidden is useless on a setter. Did you mean to annotate @Disabled instead?"/>
<property name="illegalPattern" value="true"/>
</module>
<module name="Regexp">
<property name="format" value="@Disabled.*[\n]?.*public.*get"/>
<property name="message"
value="@Disabled is useless on a getter. Did you mean to annotate @Hidden instead?"/>
<property name="illegalPattern" value="true"/>
</module>
<!-- Make the @SuppressWarnings annotations available to Checkstyle -->
<module name="SuppressWarningsHolder"/>
</module>
<module name="FileLength">
<property name="severity" value="warning"/>
<property name="max" value="300"/>
</module>
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE_OFF\: ([\w\|]+)"/>
<property name="onCommentFormat" value="CHECKSTYLE_ON\: ([\w\|]+)"/>
</module>
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CSOFF\: ([\w\|]+)"/>
<property name="onCommentFormat" value="CSON\: ([\w\|]+)"/>
<property name="checkFormat" value="$1"/>
</module>
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="(Generated)|(GENERATED)|(generated)"/>
<property name="onCommentFormat" value="CSON\: ([\w\|]+)"/>
</module>
<module name="SuppressionFilter">
<property name="file" value="${checkstyleSuppressionFile}"/>
</module>
</module>