-
Notifications
You must be signed in to change notification settings - Fork 30
/
checkstyle.xml
245 lines (203 loc) · 12.2 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
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<!-- the checks in this file are based off the Google Style Guide for Java -->
<!-- See https://google.github.io/styleguide/javaguide.html -->
<module name = "Checker">
<module name="SuppressionFilter">
<property name="file" value="checkstyle-suppress.xml" />
</module>
<!--======
= ERRORS =
=======-->
<property name="charset" value="UTF-8"/>
<module name="TreeWalker">
<!--================================================
Class Design
http://checkstyle.sourceforge.net/config_design.html
=================================================-->
<!-- Checks that each top-level class, interface or enum resides in a source file of its own.
See http://checkstyle.sourceforge.net/config_design.html#OneTopLevelClass -->
<module name="OneTopLevelClass"/>
<!--==============================================
Miscellaneous
http://checkstyle.sourceforge.net/config_misc.html
===============================================-->
<!-- Checks that the outer type name and the file name match. For example, the class Foo must be in a file named Foo.java.
See http://checkstyle.sourceforge.net/config_misc.html#OuterTypeFilename -->
<module name="OuterTypeFilename"/>
<!--====================================================
Annotations
http://checkstyle.sourceforge.net/config_annotation.html
=====================================================-->
<!-- Check location of annotation on language elements.
See http://checkstyle.sourceforge.net/config_annotation.html#AnnotationLocation -->
<module name="AnnotationLocation">
<property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/>
</module>
<module name="AnnotationLocation">
<property name="tokens" value="VARIABLE_DEF"/>
<property name="allowSamelineMultipleAnnotations" value="true"/>
</module>
<!--================================================
Blocks
http://checkstyle.sourceforge.net/config_blocks.html
=================================================-->
<!-- Checks for empty blocks.
See http://checkstyle.sourceforge.net/config_blocks.html#EmptyBlock -->
<module name="EmptyBlock">
<property name="option" value="TEXT"/>
<property name="tokens" value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
</module>
<!--================================================
Coding
http://checkstyle.sourceforge.net/config_coding.html
=================================================-->
<!-- Checks for illegal token text.
See http://checkstyle.sourceforge.net/config_coding.html#IllegalTokenText -->
<module name="IllegalTokenText">
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
<property name="format" value="\\u00(08|09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
<property name="message" value="Avoid using corresponding octal or Unicode escape."/>
</module>
<!-- Checks for fall-through in switch statements. Finds locations where a case lacks a break, return, throw or continue statement.
See http://checkstyle.sourceforge.net/config_coding.html#FallThrough -->
<module name="FallThrough"/>
<!-- Checks that switch statement has a "default" clause.
See http://checkstyle.sourceforge.net/config_coding.html#MissingSwitchDefault -->
<module name="MissingSwitchDefault"/>
<!-- Checks that each variable declaration is in its own statement and on its own line.
See http://checkstyle.sourceforge.net/config_coding.html#MultipleVariableDeclarations -->
<module name="MultipleVariableDeclarations"/>
<!-- Verifies there are no finalize() methods defined in a class.
See http://checkstyle.sourceforge.net/config_coding.html#NoFinalizer -->
<module name="NoFinalizer"/>
<!-- Checks that there is only one statement per line.
See http://checkstyle.sourceforge.net/config_coding.html#OneStatementPerLine -->
<module name="OneStatementPerLine"/>
<!--=================================================
JavaDoc
http://checkstyle.sourceforge.net/config_javadoc.html
==================================================-->
<!-- Checks the order of at-clauses.
See http://checkstyle.sourceforge.net/config_javadoc.html#AtclauseOrder -->
<module name="AtclauseOrder">
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
<property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
</module>
<!-- Checks paragraphs.
See http://checkstyle.sourceforge.net/config_javadoc.html#JavadocParagraph -->
<module name="JavadocParagraph"/>
<!-- Checks the indentation of the continuation lines in at-clauses.
See http://checkstyle.sourceforge.net/config_javadoc.html#JavadocTagContinuationIndentation -->
<module name="JavadocTagContinuationIndentation"/>
<!-- Checks that the at-clause tag is followed by description.
See http://checkstyle.sourceforge.net/config_javadoc.html#NonEmptyAtclauseDescription -->
<module name="NonEmptyAtclauseDescription"/>
<!--==============================================
Miscellaneous
http://checkstyle.sourceforge.net/config_misc.html
===============================================-->
<!-- Restrict using Unicode escapes (e.g. \u221e).
See http://checkstyle.sourceforge.net/config_misc.html#AvoidEscapedUnicodeCharacters -->
<module name="AvoidEscapedUnicodeCharacters">
<property name="allowEscapesForControlCharacters" value="true"/>
<property name="allowByTailComment" value="true"/>
<property name="allowNonPrintableEscapes" value="true"/>
</module>
<!-- Checks the style of array type definitions.
See http://checkstyle.sourceforge.net/config_misc.html#ArrayTypeStyle -->
<module name="ArrayTypeStyle"/>
<!-- Checks that long constants are defined with an upper ell.
That is ' L' and not 'l'. The capital L looks a lot like 1.
See http://checkstyle.sourceforge.net/config_misc.html#UpperEll -->
<module name="UpperEll"/>
<!--================================================
Naming Conventions
http://checkstyle.sourceforge.net/config_naming.html
=================================================-->
<!-- Validates identifiers for class type parameters.
See http://checkstyle.sourceforge.net/config_naming.html#ClassTypeParameterName -->
<module name="ClassTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern" value="Class type name ''{0}'' must match pattern ''{1}''."/>
</module>
<!-- Validates identifiers for interface type parameters.
See http://checkstyle.sourceforge.net/config_naming.html#InterfaceTypeParameterName -->
<module name="InterfaceTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern" value="Interface type name ''{0}'' must match pattern ''{1}''."/>
</module>
<!-- Validates identifiers for methods.
See http://checkstyle.sourceforge.net/config_naming.html#MethodName -->
<module name="MethodName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
<message key="name.invalidPattern" value="Method name ''{0}'' must match pattern ''{1}''."/>
</module>
<!-- Validates identifiers for method type parameters.
See http://checkstyle.sourceforge.net/config_naming.html#MethodTypeParameterName -->
<module name="MethodTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern" value="Method type name ''{0}'' must match pattern ''{1}''."/>
</module>
<!-- Validates identifiers for packages.
See http://checkstyle.sourceforge.net/config_naming.html#PackageName -->
<module name="PackageName">
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
<message key="name.invalidPattern" value="Package name ''{0}'' must match pattern ''{1}''."/>
</module>
<!-- Validates identifiers for types.
See http://checkstyle.sourceforge.net/config_naming.html#TypeName -->
<module name="TypeName">
<message key="name.invalidPattern" value="Type name ''{0}'' must match pattern ''{1}''."/>
</module>
<!--====================================================
Whitespace
http://checkstyle.sourceforge.net/config_whitespace.html
=====================================================-->
<!-- Checks that the whitespace around the Generic tokens (angle brackets) "<" and ">" are correct to the typical convention.
See http://checkstyle.sourceforge.net/config_whitespace.html#GenericWhitespace -->
<module name="GenericWhitespace">
<message key="ws.followed" value="GenericWhitespace ''{0}'' is followed by whitespace."/>
<message key="ws.preceded" value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
<message key="ws.illegalFollow" value="GenericWhitespace ''{0}'' should followed by whitespace."/>
<message key="ws.notPreceded" value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
</module>
<!-- Checks the padding between the identifier of a method definition, constructor definition, method call, or constructor invocation; and the left parenthesis of the parameter list.
See http://checkstyle.sourceforge.net/config_whitespace.html#MethodParamPad -->
<module name="MethodParamPad"/>
<!-- Checks that chosen statements are not line-wrapped.
See http://checkstyle.sourceforge.net/config_whitespace.html#NoLineWrap -->
<module name="NoLineWrap"/>
<!-- Checks the policy on how to wrap lines on operators.
See http://checkstyle.sourceforge.net/config_whitespace.html#OperatorWrap -->
<module name="OperatorWrap">
<property name="option" value="NL"/>
<property name="tokens" value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR"/>
</module>
<!-- Checks line wrapping with separators.
See http://checkstyle.sourceforge.net/config_whitespace.html#SeparatorWrap -->
<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>
<!-- Checks that a token is followed by whitespace.
See http://checkstyle.sourceforge.net/config_whitespace.html#WhitespaceAfter -->
<!-- NOTE: not part of Google style guidelines -->
<module name="WhitespaceAfter">
<!-- dont enforce on TYPECAST -->
<property name="tokens" value="COMMA, SEMI"/>
</module>
</module>
<!--========
= WARNINGS =
=========-->
<module name="TreeWalker">
<property name="severity" value="warning"/>
</module>
</module>