forked from JnRouvignac/AutoRefactor
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcheckstyle.xml
325 lines (244 loc) · 9.07 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
<?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">
<module name="Checker">
<!--
SUPPRESSION FILTERS
-->
<!-- Toggle Checkstyle on/off
// @Checkstyle:off
... ignored
// @Checkstyle:on
-->
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="@Checkstyle:off" />
<property name="onCommentFormat" value="@Checkstyle:on" />
</module>
<!-- Instruct Checkstyle to ignore a specific check for a whole file
// @Checkstyle:ignore AvoidNestedBlocks
-->
<module name="SuppressWithNearbyCommentFilter">
<property name="commentFormat" value="@Checkstyle:ignore ([\w\|]+)"/>
<property name="checkFormat" value="$1"/>
<property name="influenceFormat" value="1000000" />
</module>
<!-- Instruct Checkstyle to ignore next line
// @Checkstyle:ignore
... ignored
... checked
-->
<module name="SuppressWithNearbyCommentFilter">
<property name="commentFormat" value="@Checkstyle:ignore" />
<property name="influenceFormat" value="1" />
</module>
<!-- Instruct Checkstyle to ignore next N lines (-ve means previous lines)
// @Checkstyle:ignoreFor 2
... ignored
... ignored
... checked
-->
<module name="SuppressWithNearbyCommentFilter">
<property name="commentFormat" value="@Checkstyle:ignoreFor (\d+)" />
<property name="influenceFormat" value="$1" />
</module>
<!--
CHECKS
-->
<!-- Require a new line at the end of all source files. This was more of a
requirement from CVS, but since some editors add one automatically we
should require it anyway in order to avoid obfuscated diffs -->
<module name="NewlineAtEndOfFile" />
<!-- Disallow all tab characters. Tabs are bad bad bad -->
<module name="FileTabCharacter">
<property name="eachLine" value="true" />
</module>
<!-- Disallow trailing white space since some editors remove it automatically
resulting in obfuscated diffs -->
<module name="RegexpSingleline">
<property name="format" value="\s+$" />
<property name="message" value="Line has trailing spaces." />
</module>
<!-- Require package-info.java for all packages -->
<module name="JavadocPackage" />
<!-- Use header file template passed in from Maven -->
<!--module name="RegexpHeader">
<property name="headerFile" value="${checkstyle.header.file}" />
<property name="multiLines" value="1,2,3" />
</module-->
<module name="TreeWalker">
<!-- Enable result caching -->
<!--property name="cacheFile" value="${checkstyle.cache.file}" /-->
<!-- Required for suppressions -->
<module name="FileContentsHolder" />
<!--
JAVADOC COMMENTS
-->
<!-- Require Javadoc for all types regardless of scope -->
<module name="JavadocType">
<property name="scope" value="protected" />
</module>
<!-- Require valid Javadoc for all protected and public members -->
<module name="JavadocMethod">
<property name="scope" value="protected" />
<property name="allowUndeclaredRTE" value="true" />
<property name="allowThrowsTagsForSubclasses" value="true" />
</module>
<module name="JavadocVariable">
<property name="scope" value="protected" />
</module>
<!-- If Javadoc is present then it must be valid -->
<module name="JavadocStyle">
<property name="scope" value="protected" />
<property name="checkEmptyJavadoc" value="true" />
<property name="endOfSentenceFormat" value="([.?!:][ \t\n\r\f<])|([.?!:]$)" />
</module>
<!-- Javadoc should not contain author annotations -->
<module name="WriteTag">
<property name="tag" value="@author"/>
<property name="tagFormat" value="\S"/>
<!-- Ignore when not present -->
<property name="severity" value="ignore"/>
<!-- Warn when present -->
<property name="tagSeverity" value="error"/>
</module>
<!--
NAMING CONVENTIONS
-->
<!-- As per Sun conventions -->
<module name="ClassTypeParameterName">
<property name="format" value="^[A-Z][0-9]*$" />
</module>
<module name="LocalFinalVariableName" />
<module name="LocalVariableName" />
<module name="MemberName" />
<module name="MethodName" />
<module name="MethodTypeParameterName" >
<property name="format" value="^[A-Z][0-9]*$" />
</module>
<module name="PackageName" />
<module name="ParameterName" />
<module name="StaticVariableName" />
<module name="TypeName" />
<!-- As per Sun convention except also allowing "logger" or "xxxLogger"
since some people don't like references to "LOGGER" shouting out all
over their code -->
<module name="ConstantName">
<property name="format" value="^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$|^[a-z][a-zA-Z0-9]*Logger$|^logger$"/>
</module>
<!--
IMPORTS
-->
<!-- Unlike Sun conventions, allow wild-card static imports -->
<module name="AvoidStarImport">
<property name="allowStaticMemberImports" value="true" />
</module>
<!-- As per Sun conventions -->
<module name="IllegalImport" />
<module name="RedundantImport" />
<module name="UnusedImports">
<property name="processJavadoc" value="true" />
</module>
<!--
SIZE VIOLATIONS
-->
<!-- Unlike Sun conventions, allow lines bigger than 80 and imports to
exceed line length since they are a pain to wrap -->
<module name="LineLength">
<property name="max" value="120" />
<property name="ignorePattern" value="^import " />
</module>
<!-- Restrict classes to one per file -->
<module name="OuterTypeNumber" />
<!--
WHITE SPACE
-->
<!-- As per Sun conventions -->
<module name="EmptyForIteratorPad" />
<module name="MethodParamPad" />
<!-- Unlike Sun conventions, allow whitespace after array initializer -->
<module name="NoWhitespaceAfter">
<property name="tokens" value="BNOT,DEC,DOT,INC,LNOT,UNARY_MINUS,UNARY_PLUS" />
</module>
<module name="NoWhitespaceBefore" />
<module name="OperatorWrap" />
<module name="ParenPad" />
<module name="TypecastParenPad" />
<module name="WhitespaceAfter" />
<module name="WhitespaceAround" />
<!--
MODIFIERS
-->
<!-- As per Sun conventions -->
<!-- Do we want these? They are a bit pedantic.
<module name="ModifierOrder" />
<module name="RedundantModifier" />
-->
<!--
BLOCKS
-->
<!-- Unlike Sun conventions, align length with LineLength -->
<module name="LeftCurly">
<property name="maxLineLength" value="120" />
</module>
<!-- Unlike Sun conventions, allow nested blocks in switch statements
since these allow developers to declare case-scope local variables -->
<module name="AvoidNestedBlocks">
<property name="allowInSwitchCase" value="true" />
</module>
<!-- Unlike Sun conventions we'll allow empty blocks, but only if they are
documented -->
<module name="EmptyBlock">
<property name="option" value="text" />
</module>
<!-- As per Sun conventions -->
<module name="NeedBraces" />
<module name="RightCurly" />
<!--
CODING
-->
<!-- As per Sun conventions -->
<module name="EmptyStatement" />
<module name="EqualsHashCode" />
<module name="IllegalInstantiation" />
<!--
removed with checkstyle 6.2
<module name="RedundantThrows">
<property name="allowSubclasses" value="true" />
</module>
-->
<module name="SimplifyBooleanExpression" />
<module name="SimplifyBooleanReturn" />
<!-- Additional checks -->
<!-- String literal equality is never an optimization since the
String.equals() will check for this and will be inlined -->
<module name="StringLiteralEquality" />
<!-- Check package name is present and matches directory name as well -->
<module name="PackageDeclaration" />
<!-- Require one statement per line -->
<module name="OneStatementPerLine" />
<!--
CLASS DESIGN
-->
<!-- As per Sun conventions -->
<module name="FinalClass" />
<module name="HideUtilityClassConstructor" />
<module name="VisibilityModifier">
<property name="packageAllowed" value="true"/>
<property name="protectedAllowed" value="true"/>
</module>
<!--
MISC
-->
<!-- As per Sun conventions -->
<module name="ArrayTypeStyle" />
<module name="UpperEll" />
<!-- Require 4 character indent -->
<module name="Indentation">
<property name="caseIndent" value="0" />
<property name="throwsIndent" value="8" />
</module>
<!-- Require that file name corresponds to class name -->
<module name="OuterTypeFilename" />
</module>
</module>