-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
checkstyle.xml
176 lines (144 loc) · 7.6 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
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
<!-- Suppresses certain checks. -->
<module name="SuppressionFilter">
<property name="file" value="${checkstyle.suppressions.file}"/>
</module>
<module name="Header">
<property name="header" value="/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"/>
</module>
<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
</module>
<module name="LineLength">
<property name="max" value="120"/>
</module>
<!-- Prevent two spaces after @xxxx -->
<module name="RegexpSingleline">
<property name="format" value="\* *@\w* "/>
</module>
<module name="RegexpSingleline">
<property name="format" value="\*\*/"/>
<property name="message" value="Trailing two asterisks."/>
</module>
<module name="RegexpSingleline">
<property name="format" value="\s$"/>
<property name="message" value="Trailing whitespace found."/>
</module>
<module name="RegexpSingleline">
<property name="format" value="\(value = (\w|\d)+\)"/>
<property name="message" value="Unneeded 'value' literal."/>
</module>
<module name="RegexpMultiline">
<property name="format" value="(?<=\r?\n)\r?\n\r?\n"/>
<property name="message" value="Two empty contiguous lines"/>
</module>
<module name="RegexpMultiline">
<property name="format" value="package .*\r?\nimport"/>
<property name="message" value="Package declaration should be followed by an empty line"/>
</module>
<module name="RegexpMultiline">
<property name="format" value="\r?\n\r?\npackage"/>
<property name="message" value="Package declaration should not be preceeded by an empty line"/>
</module>
<module name="RegexpSingleline">
<property name="format" value="@JsxFunction\(\)|@JsxGetter\(\)|@JsxSetter\(\)|@JsxConstructor\(\)|@Alerts\(\)$"/>
<property name="message" value="No need to specify parentheses"/>
</module>
<module name="RegexpSingleline">
<property name="format" value="@Alerts$"/>
<property name="message" value="No need to specify empty @Alerts"/>
</module>
<module name="RegexpSingleline">
<property name="format" value="serialVersionUID"/>
<property name="message" value="No need to specify serialVersionUID"/>
</module>
<module name="RegexpSingleline">
<property name="format" value="\{ "" \}"/>
<property name="message" value="No need for the curly brackets"/>
</module>
<module name="RegexpSingleline">
<property name="format" value="@version"/>
</module>
<module name="RegexpSingleline">
<property name="format" value="^(?!import).*BrowserVersionFeatures\.[A-Z]"/>
<property name="message" value="Use static import for BrowserVersionFeatures"/>
</module>
<!--
<module name="RegexpMultiline">
<property name="id" value="sysout"/>
<property name="format" value="System\s*\.\s*(out)|(err)\s*\.\s*print(ln)?\("/>
<property name="message" value="System.out.print/ln found"/>
</module>
-->
<module name="TreeWalker">
<property name="tabWidth" value="4"/>
<module name="AnnotationUseStyle"/>
<module name="LeftCurly">
<property name="option" value="eol"/>
</module>
<module name="RightCurly">
<property name="option" value="alone"/>
<property name="tokens" value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO, STATIC_INIT, INSTANCE_INIT"/>
</module>
<!-- Checks for Naming Conventions. -->
<!-- See http://checkstyle.sf.net/config_naming.html -->
<module name="LocalFinalVariableName"/>
<!-- Checks for imports -->
<!-- See http://checkstyle.sf.net/config_imports.html -->
<module name="AvoidStarImport"/>
<module name="IllegalImport"/>
<module name="RedundantImport"/>
<module name="UnusedImports"/>
<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<module name="EmptyForInitializerPad">
<property name="option" value="space"/>
</module>
<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 name="WhitespaceAround"/>
<module name="GenericWhitespace"/>
<module name="ArrayTypeStyle"/>
<!-- Checks for correct basic indentation -->
<!-- See http://checkstyle.sf.net/config_misc.html -->
<!--
<module name="Indentation"/>
-->
<!-- Modifier Checks -->
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>
<!-- Checks for blocks. You know, those {}'s -->
<!-- See http://checkstyle.sf.net/config_blocks.html -->
<module name="AvoidNestedBlocks"/>
<module name="EmptyBlock">
<property name="option" value="text"/>
</module>
<module name="NeedBraces"/>
<module name="AnnotationUseStyle">
<property name="elementStyle" value="compact"/>
</module>
<module name="UnnecessaryParentheses">
<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, UNARY_MINUS, UNARY_PLUS, INC, DEC, LNOT, BNOT, POST_INC, POST_DEC"/>
<!-- LAND, LITERAL_INSTANCEOF, GT, LT, GE, LE, EQUAL, NOT_EQUAL -->
</module>
<module name="UnnecessarySemicolonAfterOuterTypeDeclaration"/>
<module name="UnnecessarySemicolonAfterTypeMemberDeclaration"/>
<module name="UnnecessarySemicolonInEnumeration"/>
<module name="UnnecessarySemicolonInTryWithResources"/>
<module name="FinalLocalVariable">
<property name="tokens" value="VARIABLE_DEF,PARAMETER_DEF"/>
<property name="validateEnhancedForLoopVariable" value="true"/>
</module>
<module name="MissingOverride"/>
</module>
</module>