This repository has been archived by the owner on Dec 18, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
checkstyle.xml
315 lines (289 loc) · 12.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
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<!--
Copyright (c) 2016-2017, Mihai Emil Andronache
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of camel nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@link http://checkstyle.sourceforge.net/config.html
-->
<module name="Checker">
<!--
Enforces English locale to be independent from the
default locale which may vary between environments.
-->
<property name="localeLanguage" value="en"/>
<!--
Checks that property files contain the same keys.
-->
<module name="Translation"/>
<!-- Checks for duplicate code -->
<!-- https://sourceforge.net/p/checkstyle/bugs/693/ -->
<!-- <module name="StrictDuplicateCode"/> -->
<!--
Maximum number of lines in any .java file is limited.
-->
<module name="FileLength">
<property name="max" value="1000"/>
<property name="fileExtensions" value="java"/>
</module>
<!--
TAB chars are not allowed anywhere.
-->
<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
<property name="fileExtensions" value="java,txt,xml,xsl,xsd,properties,groovy,vm,MF,sh,sql,tokens,g,spec,css,csv"/>
</module>
<!--
C++ style inline comment is not allowed.
-->
<module name="RegexpSingleline">
<property name="format" value="/\*.*\*/"/>
<property name="message" value="This kind of comment is not allowed."/>
</module>
<!--
Windows line endings are not allowed.
-->
<module name="RegexpMultiline">
<property name="format" value="\r\n$"/>
<property name="message"
value="Lines in file should end with Unix-like end of line"/>
</module>
<!--
JavaDoc regexp checks
-->
<module name="RegexpSingleline">
<property name="format" value="\* +@return +[^A-Z]"/>
<property name="fileExtensions" value="java"/>
<property name="message" value="@return tag description should start with capital letter"/>
</module>
<module name="RegexpSingleline">
<property name="format" value="\* +@param +\w+ +[^A-Z]"/>
<property name="fileExtensions" value="java"/>
<property name="message" value="@param tag description should start with capital letter"/>
</module>
<module name="RegexpSingleline">
<property name="format" value="/\*\* +[^A-Z\{]"/>
<property name="fileExtensions" value="java"/>
<property name="message" value="First sentence in a comment should start with a capital letter"/>
</module>
<module name="RegexpMultiline">
<property name="format" value="/\*\*\W+\* +[^A-Z\{]"/>
<property name="fileExtensions" value="java"/>
<property name="message" value="First sentence in a comment should start with a capital letter"/>
</module>
<module name="RegexpSingleline">
<property name="format" value="synchronized +\(this\) +\{"/>
<property name="fileExtensions" value="java"/>
<property name="message" value="Using THIS as a lock is a bad practice (use class variable instead)"/>
</module>
<module name="RegexpSingleline">
<property name="format" value="synchronized +\([\w\.]\.class\) +\{"/>
<property name="fileExtensions" value="java"/>
<property name="message" value="Using class as a lock is a bad practice (use class variable instead)"/>
</module>
<module name="RegexpSingleline">
<property name="format" value="org\.apache\.commons\.(codec|lang3?)\.CharEncoding"/>
<property name="fileExtensions" value="java"/>
<property name="message" value="Use 'java.nio.charset.StandardCharsets' instead"/>
</module>
<module name="RegexpSingleline">
<property name="format" value="^(?! *(/\*\*|\*|//)).*[\.\-\+%/\*<>] *$"/>
<property name="fileExtensions" value="java"/>
<property name="message" value="Line cannot end with this symbol, move it to the next line"/>
</module>
<module name="RegexpSingleline">
<property name="format" value="^ *="/>
<property name="fileExtensions" value="java"/>
<property name="message" value="Line cannot start with this symbol, move it to the previous line"/>
</module>
<!--
Enable suppressions
-->
<module name="SuppressWithNearbyCommentFilter">
<property name="commentFormat" value="@checkstyle (\w+) \((\d+) lines?\)"/>
<property name="checkFormat" value="$1"/>
<property name="influenceFormat" value="$2"/>
</module>
<module name="TreeWalker">
<property name="cacheFile" value="target/qulice_cachefile" />
<!-- to enable suppressions -->
<module name="FileContentsHolder"/>
<!-- Checks for blocks. -->
<module name="EmptyBlock"/>
<module name="LeftCurly"/>
<module name="NeedBraces"/>
<module name="RightCurly"/>
<module name="AvoidNestedBlocks"/>
<!-- Checks for class design. -->
<module name="VisibilityModifier"/>
<module name="FinalClass"/>
<module name="InterfaceIsType"/>
<module name="HideUtilityClassConstructor"/>
<module name="DesignForExtension"/>
<module name="MutableException"/>
<module name="ThrowsCount" />
<module name="InnerTypeLast"/>
<!-- Checks for common coding problems -->
<module name="ArrayTrailingComma"/>
<module name="AvoidInlineConditionals"/>
<module name="CovariantEquals"/>
<module name="EmptyStatement"/>
<module name="EqualsAvoidNull"/>
<module name="EqualsHashCode"/>
<module name="HiddenField">
<property name="ignoreConstructorParameter" value="true"/>
</module>
<module name="IllegalInstantiation"/>
<module name="IllegalTokenText" />
<module name="InnerAssignment"/>
<module name="MissingSwitchDefault"/>
<module name="ModifiedControlVariable"/>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<module name="StringLiteralEquality"/>
<module name="NestedForDepth"/>
<module name="NestedIfDepth">
<property name="max" value="3"/>
</module>
<module name="NestedTryDepth"/>
<module name="NoClone"/>
<module name="NoFinalizer"/>
<module name="SuperClone"/>
<module name="SuperFinalize"/>
<module name="IllegalCatch"/>
<module name="IllegalThrows"/>
<module name="PackageDeclaration"/>
<module name="ReturnCount">
<property name="max" value="1"/>
</module>
<module name="IllegalType"/>
<module name="ParameterAssignment"/>
<module name="ExplicitInitialization"/>
<module name="DefaultComesLast"/>
<module name="FallThrough"/>
<module name="MultipleVariableDeclarations"/>
<module name="RequireThis"/>
<module name="UnnecessaryParentheses"/>
<module name="OneStatementPerLine"/>
<!-- Checks for imports. -->
<module name="IllegalImport"/>
<module name="RedundantImport"/>
<module name="UnusedImports"/>
<module name="NoLineWrap"/>
<!-- Checks for Javadoc comments. -->
<module name="JavadocType">
<property name="allowUnknownTags" value="true"/>
</module>
<module name="JavadocMethod"/>
<module name="JavadocVariable"/>
<module name="JavadocStyle"/>
<!-- Metrics. -->
<module name="BooleanExpressionComplexity"/>
<module name="ClassDataAbstractionCoupling">
<property name="max" value="20"/>
</module>
<module name="ClassFanOutComplexity">
<!--
Total number of classes that a particular class
depends on. We're increasing this value because
default "20" is too low.
-->
<property name="max" value="30"/>
</module>
<module name="CyclomaticComplexity"/>
<module name="NPathComplexity"/>
<module name="JavaNCSS"/>
<!-- Miscellaneous other checks. -->
<module name="TodoComment"/>
<module name="UpperEll"/>
<module name="ArrayTypeStyle"/>
<module name="FinalParameters">
<property name="tokens" value="CTOR_DEF,METHOD_DEF,FOR_EACH_CLAUSE,LITERAL_CATCH"/>
</module>
<module name="Indentation"/>
<module name="CommentsIndentation"/>
<module name="TrailingComment"/>
<module name="OuterTypeFilename"/>
<!-- Modifier Checks. -->
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>
<!-- Checks for Naming Conventions. -->
<module name="AbbreviationAsWordInNameCheck">
<property name="allowedAbbreviations" value="IT"/>
<property name="allowedAbbreviationLength" value="1"/>
</module>
<module name="AbstractClassName"/>
<module name="ClassTypeParameterName"/>
<module name="ConstantName"/>
<module name="LocalFinalVariableName">
<property name="format" value="^(id|[A-Za-z]{3,20})$"/>
<property name="tokens" value="VARIABLE_DEF"/>
</module>
<module name="LocalVariableName">
<property name="format" value="^(i|j|k|id|[A-Za-z]{3,20})$"/>
</module>
<module name="CatchParameterName">
<property name="format" value="^(ex|[A-Za-z]{3,20})$"/>
</module>
<module name="MemberName">
<property name="format" value="^(id|[A-Za-z]{3,20})$"/>
</module>
<module name="MethodName">
<property name="format" value="^[a-z]{2,}[a-zA-Z]+$"/>
</module>
<module name="MethodTypeParameterName"/>
<module name="PackageName"/>
<module name="ParameterName">
<property name="format" value="^(id|[A-Za-z]{3,})$"/>
</module>
<module name="StaticVariableName"/>
<module name="TypeName"/>
<!-- Checks for Size Violations. -->
<module name="ExecutableStatementCount">
<property name="max" value="20"/>
</module>
<module name="LineLength">
<property name="max" value="80"/>
<property name="ignorePattern" value="^import .*$|^\s+\*\s.*https?:\/\/.+"/>
</module>
<module name="AnonInnerLength" />
<module name="MethodLength"/>
<module name="ParameterNumber">
<property name="max" value="3"/>
</module>
<module name="OuterTypeNumber"/>
<module name="MethodCount"/>
<!-- Checks for whitespace. -->
<module name="GenericWhitespace"/>
<module name="EmptyForInitializerPad"/>
<module name="EmptyForIteratorPad"/>
<module name="MethodParamPad"/>
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"/>
<module name="ParenPad"/>
<module name="TypecastParenPad"/>
<module name="WhitespaceAfter"/>
</module>
</module>