-
Notifications
You must be signed in to change notification settings - Fork 1
/
checkstyle.xml
185 lines (163 loc) · 6.95 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
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<!--
Checkstyle for Dat Developer projects
Rules:
* Indentation:
* 4 space indents, no tabs
* Comments have same indentation as code around them
* Whitespace
* Generics have typical whitespace
* No whitespace before comma, Semi-colon, Post Increment/decrement, Ellipsis, Labels
* Standard whitespace around
* Naming Conventions
* Camel Case for most
* Type parameters must be a single capital letter, optional with a number
* Constants (static final) must be uppercase snake case
* Order:
* Standard Modifier Order
* Only single annotations without parameters allowed on the same line, the rest must be on the line above
* Default always comes last in switch
Style:
* K&R style curly braces
* Brackets not enforced on blocks
* No Empty Statements
* Newline at end of file
* No Unused Imports
* No Unused local variables
* No Unnecessary semicolons
* Arrays cannot have a trailing comma
* Enums cannot have a trailing comma
* Utility classes must not have public constructor
* Exceptions must not be mutable
* Unmodified variables and parameters are final
* For loop control variables are not modified in the body of the loop
* Maximum of 2 duplicate string literals before a constant is enforced
* No string literal ==
* Javadoc
* Required for all public and protected: methods, classes, properties
* Enforced clause order
* Enforced Javadoc in valid places (Not in method body, not after annotations, etc)
* Enforced start on second line (after /**)
* Enforced Javadoc clause is not empty
* Enforced leading asterisk
* @Deprecated must be present as both annotation and JavaDoc
-->
<module name="Checker">
<!--Allow Suppressions-->
<module name="SuppressWarningsFilter" />
<!--No Tabs-->
<module name="FileTabCharacter"/>
<module name="NewlineAtEndOfFile"/>
<module name="TreeWalker">
<!--4 indents-->
<module name="Indentation"/>
<!--K&R style braces-->
<module name="LeftCurly"/>
<module name="RightCurly"/>
<!--Whitespace-->
<module name="GenericWhitespace"/>
<module name="NoWhitespaceBefore"/>
<module name="NoWhitespaceAfter">
<property name="allowLineBreaks" value="false"/>
</module>
<module name="WhitespaceAround">
<!-- Exception for empties -->
<property name="allowEmptyCatches" value="true"/>
<property name="allowEmptyConstructors" value="true"/>
<property name="allowEmptyLambdas" value="true"/>
<property name="allowEmptyLoops" value="true"/>
<property name="allowEmptyMethods" value="true"/>
<property name="allowEmptyTypes" value="true"/>
</module>
<module name="WhitespaceAfter"/>
<!--Naming Conventions-->
<module name="ConstantName"/>
<module name="MemberName"/>
<module name="StaticVariableName"/>
<module name="LocalVariableName"/>
<module name="LocalFinalVariableName"/>
<module name="PatternVariableName"/>
<module name="ParameterName"/>
<module name="LambdaParameterName"/>
<module name="MethodName"/>
<module name="TypeName"/>
<module name="ClassTypeParameterName">
<property name="format" value="^[A-Z][0-9]?$"/>
</module>
<module name="InterfaceTypeParameterName">
<property name="format" value="^[A-Z][0-9]?$"/>
</module>
<module name="MethodTypeParameterName">
<property name="format" value="^[A-Z][0-9]?$"/>
</module>
<!--Style-->
<module name="ModifierOrder"/>
<module name="CommentsIndentation"/>
<module name="UnusedImports"/>
<module name="UnusedLocalVariable"/>
<module name="AnnotationLocation"/>
<module name="MutableException"/>
<module name="EmptyStatement"/>
<module name="DefaultComesLast"/>
<module name="ModifiedControlVariable"/>
<module name="NoArrayTrailingComma"/>
<module name="NoEnumTrailingComma"/>
<module name="StringLiteralEquality"/>
<module name="UnnecessarySemicolonAfterOuterTypeDeclaration"/>
<module name="UnnecessarySemicolonAfterTypeMemberDeclaration"/>
<module name="UnnecessarySemicolonInEnumeration"/>
<module name="UnnecessarySemicolonInTryWithResources"/>
<module name="HideUtilityClassConstructor">
<property name="severity" value="warning"/>
</module>
<module name="FinalLocalVariable">
<property name="tokens" value="VARIABLE_DEF,PARAMETER_DEF"/>
<property name="validateEnhancedForLoopVariable" value="true"/>
</module>
<module name="MultipleStringLiterals">
<property name="allowedDuplicates" value="2"/>
<property name="ignoreStringsRegexp" value='^(("")|(", ")|(" ")|("\\n"))$'/>
</module>
<module name="NestedIfDepth">
<property name="severity" value="warning"/>
<property name="max" value="2"/>
</module>
<module name="NestedTryDepth">
<property name="severity" value="warning"/>
<property name="max" value="2"/>
</module>
<!--Highlight Todos-->
<module name="TodoComment">
<property name="severity" value="warning"/>
<property name="format" value="(TODO)|(FIXME)"/>
</module>
<!--Javadoc Enforce-->
<module name="JavadocVariable">
<property name="scope" value="protected"/>
</module>
<module name="MissingJavadocType">
<property name="scope" value="protected"/>
<property name="skipAnnotations" value="Generated, Mod"/>
</module>
<module name="MissingJavadocMethod">
<property name="scope" value="protected"/>
<property name="allowMissingPropertyJavadoc" value="true"/>
</module>
<!--Javadoc Style-->
<module name="SingleLineJavadoc">
<property name="ignoredTags" value="@inheritDoc, @see"/>
</module>
<module name="AtclauseOrder">
<property name="tagOrder" value="@author, @exception, @see, @param, @return, @serial, @serialData, @serialField, @deprecated, @since, @throws, @version"/>
</module>
<module name="InvalidJavadocPosition"/>
<module name="JavadocContentLocationCheck"/>
<module name="NonEmptyAtclauseDescription"/>
<module name="JavadocMissingLeadingAsterisk"/>
<module name="MissingDeprecated"/>
<module name="SuppressWarningsHolder"/>
</module>
<module name="SuppressWarningsFilter"/>
</module>