-
Notifications
You must be signed in to change notification settings - Fork 1
/
checkstyle.xml
230 lines (223 loc) · 11.7 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
<?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="fileExtensions" value="java, properties, xml"/>
<module name="SuppressionFilter">
<property name="file" value="suppressions.xml"/>
<property name="optional" value="false"/>
</module>
<module name="JavadocPackage">
<property name="severity" value="ignore"/> <!-- Cloudaware: we don't need package-info.java -->
</module>
<module name="NewlineAtEndOfFile">
<property name="lineSeparator" value="lf"/>
</module>
<module name="Translation"/>
<module name="FileLength"/>
<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
</module>
<module name="RegexpSingleline">
<property name="format" value="\s+$"/>
<property name="minimum" value="0"/>
<property name="maximum" value="0"/>
<property name="message" value="Line has trailing spaces."/>
</module>
<module name="LineLength">
<property name="max" value="200"/> <!-- Cloudaware: 80 is too narrow -->
<property name="ignorePattern" value="^\s*//.*$"/>
</module>
<module name="SuppressWarningsFilter"/>
<module name="TreeWalker">
<module name="SuppressWarningsHolder"/>
<module name="JavadocMethod">
<property name="severity" value="ignore"/> <!-- Cloudaware: not now -->
</module>
<module name="JavadocType">
<property name="severity" value="ignore"/> <!-- Cloudaware: not now -->
</module>
<module name="JavadocVariable">
<property name="severity" value="ignore"/> <!-- Cloudaware: not now -->
</module>
<module name="JavadocStyle">
<property name="severity" value="ignore"/> <!-- Cloudaware: not now -->
</module>
<module name="ConstantName">
<property name="format" value="^(_|([A-Z][A-Z0-9]*(_[A-Z0-9]+)*)[_]?)$"/> <!-- Cloudaware: we use "_"-->
</module>
<module name="LocalFinalVariableName">
<property name="format" value="^(_|[a-z][a-zA-Z0-9]*[_]?)$"/> <!-- Cloudaware: we use "_" and "asdsad_" -->
</module>
<module name="LocalVariableName">
<property name="format" value="^(_|[a-z][a-zA-Z0-9]*[_]?)$"/> <!-- Cloudaware: we use "_" and "asdsad_" -->
</module>
<module name="MemberName">
<property name="format" value="^(_|_id|[a-z][a-zA-Z0-9]*[_]?)$"/> <!-- Cloudaware: we use "_" and "asdsad_" -->
</module>
<module name="MethodName">
<property name="format" value="^(_|[a-z][a-zA-Z0-9]*[_]?)$"/> <!-- Cloudaware: we use "_" and "asdsad_" -->
</module>
<module name="PackageName">
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
</module>
<module name="ParameterName">
<property name="format" value="^(_|[a-z][a-zA-Z0-9]*[_]?)$"/> <!-- Cloudaware: we use "_" and "asdsad_" -->
</module>
<module name="StaticVariableName"/>
<module name="TypeName"/>
<module name="AvoidStarImport"/>
<module name="IllegalImport"> <!-- defaults to sun.* packages -->
<property name="illegalPkgs" value="sun"/>
<property name="illegalPkgs" value="com.google.api.client.repackaged"/>
<property name="illegalPkgs" value="com.google.cloud.dataflow.sdk.repackaged"/>
<property name="illegalPkgs" value="com.google.appengine.labs.repackaged"/>
<property name="illegalPkgs" value="com.google.appengine.repackaged"/>
<property name="illegalPkgs" value="javax.inject"/>
<property name="illegalPkgs" value="javax.servlet"/>
</module>
<module name="RedundantImport"/>
<module name="UnusedImports">
<property name="processJavadoc" value="false"/>
</module>
<module name="MethodLength">
<property name="max" value="200"/> <!-- Cloudaware: 150 is too small-->
</module>
<module name="ParameterNumber">
<property name="max" value="20"/> <!-- Cloudaware: 7 is too low -->
</module>
<module name="EmptyForIteratorPad"/>
<module name="GenericWhitespace"/>
<module name="MethodParamPad"/>
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"/>
<module name="ParenPad"/>
<module name="TypecastParenPad"/>
<module name="WhitespaceAfter"/>
<module name="WhitespaceAround"/>
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>
<module name="AvoidNestedBlocks">
<property name="severity" value="ignore"/> <!-- Cloudaware: it's ok for us -->
</module>
<module name="EmptyBlock">
<property name="severity" value="ignore"/> <!-- Cloudaware: it's ok for us -->
</module>
<module name="LeftCurly"/>
<module name="NeedBraces"/>
<module name="RightCurly"/>
<module name="AvoidInlineConditionals">
<property name="severity" value="ignore"/> <!-- Cloudaware: we use ?: operators -->
</module>
<module name="EmptyStatement"/>
<module name="EqualsHashCode"/>
<module name="HiddenField">
<property name="ignoreConstructorParameter" value="true"/> <!-- Cloudaware: we use same names in constructors -->
<property name="ignoreSetter" value="true"/> <!-- Cloudaware: we use same names in setters -->
<property name="setterCanReturnItsClass" value="true"/>
</module>
<module name="IllegalInstantiation"/>
<module name="InnerAssignment"/>
<module name="MagicNumber">
<property name="ignoreNumbers"
value="-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9"/> <!-- Cloudaware: add 24, 60 and 1000 for timestamps -->
<property name="ignoreHashCodeMethod" value="true"/> <!-- Cloudaware: for auto-generated hashCode -->
<property name="ignoreAnnotation" value="true"/> <!-- Cloudaware: e.g. ORMLite annotatios -->
</module>
<module name="MissingSwitchDefault"/>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<module name="DesignForExtension">
<property name="ignoredAnnotations" value="Test, Before, After, BeforeClass, AfterClass, Override"/> <!-- Cloudaware: Override added -->
</module>
<module name="FinalClass"/>
<module name="HideUtilityClassConstructor"/>
<module name="InterfaceIsType"/>
<module name="VisibilityModifier">
<property name="allowPublicImmutableFields" value="true"/> <!-- Cloudaware: we use "public final" for variables -->
<property name="protectedAllowed" value="true"/> <!-- Cloudaware: we use "protected" variables -->
<property name="packageAllowed" value="true"/> <!-- Cloudaware: we use "" visibility-->
<property name="ignoreAnnotationCanonicalNames" value="com.gigware.goldmine.IgnoreVisibility"/> <!-- Cloudaware: our custom annotation -->
</module>
<module name="ArrayTypeStyle"/>
<module name="FinalParameters"/>
<module name="TodoComment">
<property name="severity" value="ignore"/> <!-- Cloudaware: not interested -->
</module>
<module name="UpperEll"/>
<!-- Cloudaware extra checks -->
<module name="AnnotationLocation" />
<module name="AnnotationUseStyle" />
<module name="MissingDeprecated" />
<module name="MissingOverride" />
<module name="PackageAnnotation" />
<module name="SuppressWarnings" />
<module name="EmptyCatchBlock">
<property name="commentFormat" value="This is expected"/>
<property name="exceptionVariableName" value="expected|ignore"/>
</module>
<module name="InnerTypeLast" />
<module name="InterfaceIsType"/>
<module name="MutableException"/>
<module name="OneTopLevelClass"/>
<module name="CovariantEquals"/>
<module name="DeclarationOrder"/>
<module name="DefaultComesLast"/>
<module name="EqualsAvoidNull"/>
<module name="ExplicitInitialization"/>
<module name="FallThrough"/>
<module name="FinalLocalVariable">
<property name="validateEnhancedForLoopVariable" value="true"/>
</module>
<module name="IllegalThrows"/>
<module name="IllegalToken"/>
<module name="IllegalTokenText" />
<module name="IllegalType">
<!-- Cloudaware: sometimes we want to inherit from HashMap, LinkedHashMap, LinkedHashSet and others classes. -->
<!-- Cloudaware: remove CLASS_DEF -->
<property name="tokens" value="ANNOTATION_FIELD_DEF, INTERFACE_DEF, METHOD_CALL, METHOD_DEF, METHOD_REF, PARAMETER_DEF, VARIABLE_DEF, PATTERN_VARIABLE_DEF, RECORD_DEF, RECORD_COMPONENT_DEF"/>
</module>
<module name="ModifiedControlVariable"/>
<!--<module name="MultipleStringLiterals"/>--> <!-- ?????? -->
<module name="MultipleVariableDeclarations"/>
<!--<module name="NoClone"/>-->
<module name="NoFinalizer"/>
<module name="OneStatementPerLine"/>
<module name="OverloadMethodsDeclarationOrder"/>
<module name="ParameterAssignment"/>
<module name="StringLiteralEquality"/>
<module name="UnnecessaryParentheses">
<!-- Cloudaware: default, but LAND,LOR, removed -->
<property name="tokens" value="EXPR,IDENT,NUM_DOUBLE,NUM_FLOAT,NUM_INT,NUM_LONG,STRING_LITERAL,LITERAL_NULL,LITERAL_FALSE,LITERAL_TRUE,ASSIGN,BAND_ASSIGN,BOR_ASSIGN,BSR_ASSIGN,BXOR_ASSIGN,DIV_ASSIGN,MINUS_ASSIGN,MOD_ASSIGN,PLUS_ASSIGN,SL_ASSIGN,SR_ASSIGN,STAR_ASSIGN,LAMBDA,TEXT_BLOCK_LITERAL_BEGIN,LITERAL_INSTANCEOF,GT,LT,GE,LE,EQUAL,NOT_EQUAL,UNARY_MINUS,UNARY_PLUS,INC,DEC,LNOT,BNOT,POST_INC,POST_DEC"/>
</module>
<module name="VariableDeclarationUsageDistance"/>
<module name="AvoidEscapedUnicodeCharacters"/>
<!--<module name="CommentsIndentation"/>--> <!-- ?????? -->
<module name="OuterTypeFilename"/>
<!--<module name="AbbreviationAsWordInName">-->
<!--<property name="ignoreFinal" value="false"/>-->
<!--<property name="allowedAbbreviationLength" value="1"/>-->
<!--</module>-->
<module name="CatchParameterName">
<property name="format" value="^(e|t|ex|[a-z][a-zA-Z]+)$"/>
</module>
<module name="ClassTypeParameterName">
<property name="format" value="(^[A-Z][a-zA-Z0-9]*)$"/>
</module>
<module name="EmptyLineSeparator">
<property name="allowNoEmptyLineBetweenFields" value="true"/>
<property name="allowMultipleEmptyLines" value="false" />
<property name="allowMultipleEmptyLinesInsideClassMembers" value="false" />
</module>
<module name="MatchXpath">
<property name="query" value="//SINGLE_LINE_COMMENT[./COMMENT_CONTENT[not(starts-with(@text, ' ')) and string-length(translate(@text, '\n\r', '')) > 0 and not(starts-with(@text, 'noinspection'))]]" />
<message key="matchxpath.match" value="Single line comment policy violated" />
</module>
<module name="MatchXpath">
<property name="query" value="//SINGLE_LINE_COMMENT[./COMMENT_CONTENT[starts-with(normalize-space(upper-case(@text)), 'TODO') and not(starts-with(@text, ' TODO: '))]]" />
<message key="matchxpath.match" value="TODO policy violated. The comment should starts with '// TODO: '" />
</module>
</module>
</module>