forked from crosswire/jsword
-
Notifications
You must be signed in to change notification settings - Fork 7
/
JSword.checkstyle.xml
438 lines (411 loc) · 14.1 KB
/
JSword.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
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
<!-- property name="basedir" value="${checkstyle.basedir}"/> -->
<property name="charset" value="UTF-8"/>
<property name="severity" value="warning"/>
<property name="fileExtensions" value="java"/>
<!-- Checks for Javadoc Comments. Buggy, when run on tests.
<module name="JavadocPackage">
<property name="allowLegacy" value="true"/>
</module>
-->
<module name="NewlineAtEndOfFile"/>
<module name="Translation"/>
<module name="FileLength">
<property name="max" value="2000"/>
</module>
<module name="FileTabCharacter"/>
<!-- Header checks would be good to do, in order to verify that license is present.
<module name="Header"/>
<module name="RegexpHeader"/>
-->
<!-- module name="RegexpHeader">
<property
name="headerFile"
value="${checkstyle.header.file}"/>
</module -->
<module name="UniqueProperties"/>
<module name="TreeWalker">
<!-- property name="cacheFile" value="${checkstyle.cache.file}"/> -->
<!-- Checks for Annotations -->
<module name="AnnotationLocation"/> <!-- new -->
<module name="AnnotationUseStyle"/>
<module name="MissingDeprecated"/>
<module name="MissingOverride"/>
<module name="PackageAnnotation"/>
<module name="SuppressWarnings"/>
<module name="SuppressWarningsHolder"/> <!-- new -->
<!-- Checks for Javadoc Comments -->
<!-- This would be a big change. Very slow.
<module name="AtclauseOrder"/>
-->
<!-- Should do this
<module name="JavadocMethod">
<property name="scope" value="public"/>
</module>
-->
<!-- This would be a big change. Very slow.
<module name="JavadocParagraph"/>
-->
<!-- Should do this
<module name="JavadocStyle">
<property name="scope" value="public"/>
</module>
-->
<!-- This would be a big change. Very, very slow.
<module name="JavadocTagContinuationIndentation"/>
-->
<module name="JavadocType">
<property name="authorFormat" value="\S"/>
</module>
<!-- This would be a big change
<module name="JavadocType">
<property name="scope" value="public"/>
</module>
-->
<!-- Should do this
<module name="JavadocVariable">
<property name="scope" value="public"/>
</module>
-->
<!-- Should do this. Very, very slow.
<module name="NonEmptyAtclauseDescription"/>
-->
<module name="SingleLineJavadoc"/>
<!-- Should do this
<module name="SummaryJavadoc"/>
-->
<!-- The following would need to be configured to be useful.
<module name="WriteTag"/>
-->
<!-- Checks for Naming Conventions -->
<!-- Would change API
<module name="AbbreviationAsWordInName"/>
-->
<module name="AbstractClassName">
<property name="format" value="^Abstract.*$"/>
</module>
<!-- module name="CatchParameterName"/ -->
<module name="ClassTypeParameterName"/>
<!-- Allow "log" and "instance" otherwise only upper case valid variables with _ -->
<module name="ConstantName">
<property name="format" value="^(log|instance|([A-Z][A-Z0-9]*(_[A-Z0-9]+)*))$"/>
</module>
<module name="InterfaceTypeParameterName"/>
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<module name="MemberName"/>
<module name="MethodName"/>
<module name="MethodTypeParameterName"/>
<module name="PackageName">
<property name="format" value="^[a-z]+(\.[a-z]([a-z0-9]{1,13}|[a-z0-9]+tion))*$"/>
</module>
<module name="ParameterName"/>
<module name="StaticVariableName"/>
<module name="TypeName"/>
<!-- Checks for imports -->
<module name="AvoidStarImport"/>
<module name="AvoidStaticImport"/>
<module name="IllegalImport"/>
<module name="RedundantImport"/>
<module name="UnusedImports"/>
<!-- Would need to be configured to be useful
<module name="CustomImportOrder"/>
<module name="ImportControl"/>
<module name="ImportOrder"/>
-->
<!-- Checks for Size Violations -->
<!--
<module name="AnonInnerLength">
<property name="max" value="60"/>
</module>
-->
<!--
<module name="ExecutableStatementCount">
<property name="max" value="20"/>
<property name="tokens" value="CTOR_DEF,METHOD_DEF,INSTANCE_INIT,STATIC_INIT"/>
</module>
-->
<!--
<module name="LineLength">
<property name="max" value="256"/>
</module>
-->
<module name="MethodCount">
<property name="maxTotal" value="100"/>
<property name="maxPrivate" value="20"/>
<property name="maxPackage" value="10"/>
<property name="maxProtected" value="20"/>
<property name="maxPublic" value="50"/>
</module>
<!--
<module name="MethodLength">
<property name="tokens" value="METHOD_DEF"/>
<property name="max" value="300"/>
<property name="countEmpty" value="false"/>
</module>
<module name="MethodLength">
<property name="tokens" value="CTOR_DEF"/>
<property name="max" value="500"/>
<property name="countEmpty" value="false"/>
</module>
-->
<module name="OuterTypeNumber"/>
<module name="ParameterNumber">
<property name="max" value="7"/>
<property name="tokens" value="CTOR_DEF,METHOD_DEF"/>
</module>
<!-- Checks for Whitespace -->
<module name="EmptyForInitializerPad">
<property name="option" value="space"/>
</module>
<module name="EmptyForIteratorPad">
<property name="option" value="space"/>
</module>
<module name="GenericWhitespace"/>
<module name="MethodParamPad">
<property name="tokens" value="CTOR_DEF, LITERAL_NEW, METHOD_CALL, METHOD_DEF, SUPER_CTOR_CALL"/> <!-- , ENUM_CONSTANT_DEF -->
</module>
<module name="NoWhitespaceAfter">
<property name="tokens" value="BNOT, DEC, DOT, INC, LNOT, UNARY_MINUS, UNARY_PLUS"/><!-- ARRAY_INIT, -->
<property name="allowLineBreaks" value="false"/>
</module>
<module name="NoWhitespaceBefore">
<property name="tokens" value="SEMI, POST_DEC, POST_INC"/>
<property name="allowLineBreaks" value="false"/>
</module>
<module name="OperatorWrap"/>
<module name="ParenPad">
<property name="option" value="nospace"/>
</module>
<module name="SeparatorWrap">
<property name="tokens" value="DOT"/>
<property name="option" value="NL"/>
</module>
<module name="SeparatorWrap">
<property name="tokens" value="COMMA"/>
<property name="option" value="EOL"/>
</module>
<module name="TypecastParenPad">
<property name="option" value="nospace"/>
</module>
<module name="WhitespaceAfter"/>
<module name="WhitespaceAround"/>
<!-- End of whitespace rules -->
<!-- Modifier Checks -->
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>
<!-- Checks for blocks -->
<module name="AvoidNestedBlocks"/>
<module name="EmptyBlock">
<property name="option" value="text"/>
</module>
<module name="EmptyCatchBlock"> <!-- new -->
<property name="commentFormat" value="This is allowed"/>
<property name="exceptionVariableName" value="expected"/>
</module>
<module name="LeftCurly">
<property name="option" value="nlow"/>
</module>
<module name="NeedBraces"/>
<module name="RightCurly">
<property name="option" value="same"/>
</module>
<!-- Checks for Coding problems -->
<!-- JSword does not require trailing comma on arrays
<module name="ArrayTrailingComma"/>
-->
<!-- We are not ready for this
<module name="AvoidInlineConditionals"/>
-->
<module name="CovariantEquals"/>
<!-- JSword has its own conventions for declaration order
<module name="DeclarationOrder"/>
-->
<module name="DefaultComesLast"/>
<!-- module name="DoubleCheckedLocking"/ not in 5.6 -->
<module name="EmptyStatement"/>
<module name="EqualsAvoidNull"/>
<module name="EqualsHashCode"/>
<module name="ExplicitInitialization"/>
<module name="FallThrough"/>
<!-- We are not ready for this
<module name="FinalLocalVariable">
<property name="tokens" value="VARIABLE_DEF"/>
<property name="tokens" value="PARAMETER_DEF"/>
</module>
-->
<module name="HiddenField">
<property name="tokens" value="VARIABLE_DEF"/>
</module>
<module name="IllegalCatch"/>
<module name="IllegalInstantiation">
<property name="classes" value="java.lang.Boolean, java.lang.String"/>
</module>
<module name="IllegalThrows"/>
<!-- Are there any features of Java that are not allowed? Not for JSword.
<module name="IllegalToken"/>
-->
<!-- Example usage
<module name="IllegalTokenText">
<property name="tokens" value="STRING_LITERAL"/>
<property name="format" value="a href"/>
</module>
-->
<module name="IllegalTokenText">
<property name="tokens" value="NUM_INT,NUM_LONG"/>
<property name="format" value="^0[^lx]"/>
<property name="ignoreCase" value="true"/>
</module>
<!-- We are not ready for this
<module name="IllegalType"/>
-->
<module name="InnerAssignment"/>
<!-- JSword uses tables of numbers
<module name="MagicNumber"/>
-->
<!-- We are not ready for this
<module name="MissingCtor"/>
-->
<module name="MissingSwitchDefault"/>
<module name="ModifiedControlVariable"/>
<module name="MultipleStringLiterals">
<property name="allowedDuplicates" value="10"/>
</module>
<module name="MultipleVariableDeclarations"/>
<module name="NestedForDepth">
<property name="max" value="3"/>
</module>
<module name="NestedIfDepth">
<property name="max" value="3"/>
</module>
<module name="NestedTryDepth">
<property name="max" value="3"/>
</module>
<!-- Are there any features of Java that are not allowed? Not for JSword.
<module name="NoClone"/>
<module name="NoFinalizer"/>
-->
<module name="OneStatementPerLine"/>
<module name="OverloadMethodsDeclarationOrder"/>
<module name="PackageDeclaration"/>
<!-- <module name="ParameterAssignment"/> -->
<!-- JSword does not require "this"
<module name="RequireThis"/>
-->
<!-- We are not ready for this
<module name="ReturnCount">
<property name="max" value="3"/>
</module>
-->
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<module name="StringLiteralEquality"/>
<module name="SuperClone"/>
<module name="SuperFinalize"/>
<module name="UnnecessaryParentheses"/>
<!-- We are not ready for this
<module name="VariableDeclarationUsageDistance"/>
-->
<!-- Buggy
<module name="RedundantThrows"/>
-->
<!-- <module name="JUnitTestCase"/> Removed in 6.2 -->
<!-- Class Design Checks -->
<!-- This would be a big change
<module name="DesignForExtension"/>
-->
<module name="FinalClass"/>
<module name="InterfaceIsType"/>
<module name="HideUtilityClassConstructor"/>
<!-- This would be a big change
<module name="InnerTypeLast"/>
tried -->
<module name="InterfaceIsType"/> <!-- new -->
<module name="MutableException"/>
<module name="OneTopLevelClass"/> <!-- new -->
<!-- We are not ready for this
<module name="ThrowsCount">
<property name="max" value="2"/>
</module>
-->
<module name="VisibilityModifier">
<property name="protectedAllowed" value="true"/>
</module>
<!-- The ant task cpd does this
<module name="StrictDuplicateCode"/>
-->
<!-- Metrics Checks
<module name="BooleanExpressionComplexity">
<property name="max" value="3"/>
</module>
<module name="ClassDataAbstractionCoupling">
<property name="max" value="7"/>
</module>
<module name="ClassFanOutComplexity">
<property name="max" value="20"/>
</module>
<module name="CyclomaticComplexity">
<property name="max" value="10"/>
</module>
<module name="NPathComplexity">
<property name="max" value="200"/>
</module>
<module name="JavaNCSS">
<property name="methodMaximum" value="40"/>
</module>
<module name="NPathComplexity">
<property name="max" value="1000"/>
</module>
-->
<!-- Miscellaneous Checks -->
<module name="ArrayTypeStyle"/>
<!-- Too big to tackle now. Slow too.
<module name="AvoidEscapedUnicodeCharacters">
<property name="allowEscapesForControlCharacters" value="true"/>
<property name="allowByTailComment" value="true"/>
<property name="allowIfAllCharactersEscaped" value="true"/>
<property name="allowNonPrintableEscapes" value="true"/>
</module>
-->
<!-- Should do.
<module name="CommentsIndentation"/>
-->
<module name="DescendantToken"/>
<!--
<module name="FileContentsHolder"/>
-->
<!-- This would be a big change
<module name="FinalParameters"/>
tried -->
<!-- This would be a big change
<module name="Indentation"/>
tried -->
<module name="OuterTypeFilename"/>
<module name="TodoComment"/>
<module name="RegexpSinglelineJava">
<property name="format" value="((public)|(protected))\s+void\s+finalize\(\s*\)"/>
</module>
<!-- Check to find trailing whitespace at the end of a line -->
<module name="RegexpSinglelineJava">
<property name="format" value="\s$"/>
<property name="ignoreComments" value="true"/>
<property name="message" value="Line has trailing spaces."/>
</module>
<module name="UncommentedMain">
<property name="excludedClasses" value="\.(Desktop|APIExamples|XalanProcess|XMLProcess|BibleToOsis|DictToOsis|BibleScope|BookExporter|BookInstaller|BookLookup|StrongsAnalysis|FTPExample|ConfParser|GatherAllReferences|ReadEverything)$"/>
</module>
<module name="UpperEll"/>
<!-- This would be a big change.
<module name="TrailingComment"/>
tried -->
<!-- Perhaps we should check for the GPL license @author, @id, ...
<module name="RequiredRegexp"/>
-->
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>
</module>
</module>