This repository has been archived by the owner on Nov 3, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
/
checkstyle-rules.xml
266 lines (261 loc) · 11.3 KB
/
checkstyle-rules.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
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to Jasig under one or more contributor license
agreements. See the NOTICE file distributed with this work
for additional information regarding copyright ownership.
Jasig licenses this file to you under the Apache License,
Version 2.0 (the "License"); you may not use this file
except in compliance with the License. You may obtain a
copy of the License at the following location:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<!--
This configuration file was written by the eclipse-cs plugin configuration editor
-->
<!--
Checkstyle-Configuration: CAS
Description:
Checkstyle configuration based on Sun's conventions, compliant with CAS coding conventions. The conventions are documented at https://wiki.jasig.org/display/CAS/Code+Conventions
-->
<module name="Checker">
<property name="severity" value="warning"/>
<property name="charset" value="UTF-8"/>
<module name="TreeWalker">
<property name="tabWidth" value="4"/>
<module name="JavadocMethod">
<property name="severity" value="error"/>
<property name="allowUndeclaredRTE" value="true"/>
<property name="allowMissingPropertyJavadoc" value="true"/>
<property name="suppressLoadErrors" value="true"/>
</module>
<module name="JavadocType">
<property name="severity" value="error"/>
<property name="scope" value="public"/>
<property name="allowMissingParamTags" value="true" />
</module>
<module name="JavadocVariable">
<property name="severity" value="error"/>
<property name="scope" value="package" />
</module>
<module name="JavadocStyle">
<property name="severity" value="error"/>
</module>
<module name="ConstantName">
<property name="severity" value="error"/>
<property name="format" value="(^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$)"/>
</module>
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<module name="MemberName"/>
<module name="MethodName"/>
<module name="PackageName"/>
<module name="ParameterName"/>
<module name="StaticVariableName">
<property name="severity" value="error"/>
<property name="format" value="(^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$)"/>
</module>
<module name="TypeName"/>
<module name="AvoidStarImport">
<property name="severity" value="error"/>
<property name="allowStaticMemberImports" value="true"/>
</module>
<module name="IllegalImport">
<property name="severity" value="error"/>
</module>
<module name="RedundantImport">
<property name="severity" value="error"/>
</module>
<module name="UnusedImports">
<property name="severity" value="error"/>
</module>
<module name="MethodLength"/>
<module name="ParameterNumber">
<property name="max" value="10" />
<property name="severity" value="error"/>
<property name="tokens" value="METHOD_DEF" />
</module>
<module name="LineLength">
<property name="max" value="170"/>
<property name="tabWidth" value="4"/>
<property name="severity" value="error"/>
</module>
<module name="EmptyForIteratorPad"/>
<module name="MethodParamPad">
<property name="severity" value="error"/>
</module>
<module name="NoWhitespaceAfter">
<property name="severity" value="error"/>
</module>
<module name="NoWhitespaceBefore">
<property name="severity" value="error"/>
</module>
<module name="OperatorWrap">
<property name="severity" value="error"/>
</module>
<module name="ParenPad"/>
<module name="TypecastParenPad"/>
<module name="WhitespaceAfter">
<property name="severity" value="error"/>
</module>
<module name="ModifierOrder">
<property name="severity" value="error"/>
</module>
<module name="RedundantModifier">
<property name="severity" value="error"/>
</module>
<module name="AvoidNestedBlocks"/>
<module name="EmptyBlock">
<property name="severity" value="error"/>
</module>
<module name="LeftCurly">
<property name="severity" value="error"/>
</module>
<module name="NeedBraces">
<property name="severity" value="error"/>
</module>
<module name="RightCurly"/>
<module name="EmptyStatement"/>
<module name="EqualsHashCode"/>
<module name="IllegalInstantiation"/>
<module name="InnerAssignment"/>
<module name="MissingSwitchDefault">
<property name="severity" value="error"/>
</module>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<module name="FinalClass">
<property name="severity" value="error"/>
</module>
<module name="HideUtilityClassConstructor">
<property name="severity" value="error"/>
</module>
<module name="InterfaceIsType"/>
<module name="VisibilityModifier">
<property name="severity" value="error"/>
<property name="protectedAllowed" value="true"/>
</module>
<module name="ArrayTypeStyle">
<property name="severity" value="error"/>
</module>
<module name="FinalParameters">
<property name="severity" value="error"/>
<property name="tokens" value="METHOD_DEF, CTOR_DEF, LITERAL_CATCH"/>
</module>
<module name="FinalLocalVariable">
<property name="severity" value="error"/>
<property name="tokens" value="PARAMETER_DEF, VARIABLE_DEF"/>
</module>
<module name="TodoComment">
<property name="severity" value="error"/>
</module>
<module name="UpperEll"/>
<module name="MissingOverride">
<property name="severity" value="error"/>
</module>
<module name="MissingDeprecated">
<property name="severity" value="error"/>
</module>
</module>
<module name="NewlineAtEndOfFile">
<property name="fileExtensions" value="java, xml, properties, txt"/>
<property name="lineSeparator" value="lf" />
<property name="severity" value="error" />
</module>
<module name="Translation">
<property name="severity" value="ignore"/>
</module>
<module name="FileLength"/>
<module name="FileTabCharacter">
<property name="severity" value="error"/>
</module>
<module name="RegexpSingleline">
<metadata name="net.sf.eclipsecs.core.comment" value="Trailing spaces"/>
<property name="severity" value="error"/>
<property name="format" value="\w+\s+$"/>
<property name="message" value="Line has trailing spaces."/>
</module>
<module name="RegexpSingleline">
<metadata name="net.sf.eclipsecs.core.comment" value="The logger object must be named "logger""/>
<property name="severity" value="error"/>
<property name="format" value="\s+(static\s)*(final\s)*(static\s)*Logger\s+(log|LOG)\b"/>
<property name="message" value="The Logger object must only be called "logger" or "LOGGER""/>
</module>
<module name="RegexpSingleline">
<metadata name="net.sf.eclipsecs.core.comment" value="Qualifying logger with the "this" keyword"/>
<property name="severity" value="error"/>
<property name="format" value="((this\.logger)|(super\.logger))\.\w+\("/>
<property name="message" value="The Logger object need not be qualified with the "this" keyword"/>
</module>
<module name="RegexpSingleline">
<metadata name="net.sf.eclipsecs.core.comment" value="Using @Test instead of extending TestCase"/>
<property name="severity" value="error"/>
<property name="format" value="class\s+\w+\s+extends\s+(junit\.framework\.)*TestCase"/>
<property name="message" value="All testcase must use annotations (@Test) instead of extending junit.framework.TestCase"/>
</module>
<module name="RegexpSingleline">
<metadata name="net.sf.eclipsecs.core.comment" value="Using the junit.framework package"/>
<property name="severity" value="error"/>
<property name="format" value="junit.framework"/>
<property name="message" value="The package junit.framework belongs to JUnit v3. Use org.junit instead."/>
</module>
<module name="RegexpSingleline">
<metadata name="net.sf.eclipsecs.core.comment" value="Checking for logging level"/>
<property name="severity" value="warning"/>
<property name="format" value="log\.is\w+Enabled\("/>
<property name="message" value="If the construction of the log message is cheap, consider not checking for logging levels."/>
</module>
<module name="RegexpSingleline">
<metadata name="net.sf.eclipsecs.core.comment" value="Space instead of tabs"/>
<property name="severity" value="error"/>
<property name="format" value="^\t+"/>
<property name="message" value="Tabs should never be used for indentation. Use spaces instead"/>
</module>
<module name="RegexpSingleline">
<metadata name="net.sf.eclipsecs.core.comment" value="Space after cast"/>
<property name="severity" value="error"/>
<property name="format" value="\(\w+\)\w+"/>
<property name="message" value="There are no spaces after cast."/>
</module>
<module name="RegexpSingleline">
<metadata name="net.sf.eclipsecs.core.comment" value="Parameteric log messages"/>
<property name="severity" value="error"/>
<property name="format" value="log\.\w+\(((\".+\"\s*\+)|(.*\s*\+\s*\"))"/>
<property name="message" value="Avoid string concatenation for constructing log messages. Use parametric messages instead"/>
</module>
<module name="RegexpSingleline">
<metadata name="net.sf.eclipsecs.core.comment" value="JavaDoc @version tag"/>
<property name="severity" value="error"/>
<property name="format" value="@version\s+(.+)*(\$Revision|\$Date)"/>
<property name="message" value="Invalid JavaDoc @version tag."/>
</module>
<module name="RegexpSingleline">
<metadata name="net.sf.eclipsecs.core.comment" value="Logging framework selection"/>
<property name="severity" value="error"/>
<property name="format" value="LogFactory\.getLog"/>
<property name="message" value="CAS uses the slf4j logging framework."/>
</module>
<module name="RegexpSingleline">
<property name="id" value="sysOutConsoleLogs" />
<metadata name="net.sf.eclipsecs.core.comment" value="Console output messages"/>
<property name="severity" value="error"/>
<property name="format" value="System\.(out|err)"/>
<property name="message" value="Avoid sending messages to the console directly. Use a logger object instead"/>
</module>
<module name="RegexpSingleline">
<property name="id" value="stackTraceConsoleLogs" />
<metadata name="net.sf.eclipsecs.core.comment" value="Printing stack traces to the console"/>
<property name="severity" value="error"/>
<property name="format" value="\.printStackTrace\(\)"/>
<property name="message" value="Avoid sending stack traces to the console directly. Use a logger object instead"/>
</module>
<module name="SuppressionFilter">
<property name="file" value="${checkstyle.suppressions.file}"/>
</module>
</module>