forked from apache/mina-sshd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sshd-checkstyle.xml
328 lines (306 loc) · 14.6 KB
/
sshd-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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<!--
Checkstyle configuration that checks the SSHD coding conventions.
Checkstyle is very configurable. Be sure to read the documentation at
http://checkstyle.sf.net (or in your downloaded distribution).
To completely disable a check, just comment it out or delete it from the file.
Authors: Guillaume Nodet, Goldstein Lyor
-->
<module name="Checker">
<!-- Checks whether files end with a new line. -->
<!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
<!--
<module name="NewlineAtEndOfFile" />
-->
<!-- Checks that property files contain the same keys. -->
<!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
<module name="Translation" />
<!--<module name="StrictDuplicateCode" />-->
<module name="TreeWalker">
<property name="fileExtensions" value="java" />
<!-- Checks for Javadoc comments. -->
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
<!--
<module name="PackageHtml" />
<module name="JavadocMethod" />
<module name="JavadocType" />
<module name="JavadocVariable" />
<module name="JavadocStyle" />
-->
<!-- Check annotations conventions -->
<!-- See http://checkstyle.sourceforge.net/config_annotation.html -->
<module name="MissingOverride" />
<module name="MissingDeprecated" />
<module name="AnnotationLocation">
<property name="allowSamelineMultipleAnnotations" value="false" />
<property name="allowSamelineSingleParameterlessAnnotation" value="false" />
<property name="allowSamelineParameterizedAnnotation" value="false" />
</module>
<!-- Checks for Naming Conventions. -->
<!-- See http://checkstyle.sf.net/config_naming.html -->
<module name="ConstantName" />
<module name="LocalFinalVariableName" />
<module name="LocalVariableName">
<property name="format" value="^[a-z][a-zA-Z0-9_]*$" />
</module>
<module name="MemberName">
<property name="format" value="^[a-z][a-zA-Z0-9_]*$" />
</module>
<module name="MethodName" />
<!-- Allow only lowercase and digits in package name -->
<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_]*$" />
</module>
<module name="InterfaceTypeParameterName">
<property name="format" value="^[A-Z]+$" />
</module>
<module name="StaticVariableName" />
<module name="TypeName" />
<!-- Checks for imports -->
<!-- See http://checkstyle.sf.net/config_imports.html -->
<module name="AvoidStarImport" />
<module name="AvoidStaticImport" />
<module name="IllegalImport" /><!-- defaults to sun.* packages -->
<module name="RedundantImport" />
<module name="UnusedImports" />
<module name="ImportOrder">
<property name="groups" value="java,javax,org,net,io,com,*" />
<property name="ordered" value="true" />
<property name="separated" value="true" />
</module>
<!--
<module name="ImportControl">
<property name="file" value="etc/import-control.xml" />
</module>
-->
<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<module name="AnonInnerLength">
<property name="max" value="50" />
</module>
<module name="ExecutableStatementCount">
<property name="max" value="100" />
</module>
<module name="LineLength">
<property name="max" value="180" />
</module>
<module name="MethodLength">
<property name="max" value="150" />
<property name="countEmpty" value="false" />
</module>
<module name="ParameterNumber">
<property name="max" value="8" />
</module>
<module name="OuterTypeNumber">
<property name="max" value="2"/>
</module>
<module name="MethodCount">
<property name="maxPrivate" value="5"/>
<property name="maxPackage" value="5"/>
</module>
<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<module name="EmptyForIteratorPad" />
<module name="EmptyForInitializerPad" />
<module name="MethodParamPad" />
<module name="WhitespaceAfter" />
<module name="NoWhitespaceBefore">
<property name="tokens" value="COMMA,ELLIPSIS,SEMI,POST_INC,POST_DEC,METHOD_REF" />
</module>
<module name="NoWhitespaceAfter">
<property name="tokens" value="ARRAY_INIT,BNOT,DEC,DOT,INC,AT,LNOT,UNARY_MINUS,UNARY_PLUS,METHOD_REF" />
</module>
<module name="EmptyLineSeparator">
<property name="tokens" value="IMPORT,CLASS_DEF,INTERFACE_DEF,STATIC_INIT,INSTANCE_INIT,METHOD_DEF,CTOR_DEF" />
<property name="allowMultipleEmptyLines" value="false" />
<property name="allowNoEmptyLineBetweenFields" value="true" />
<property name="allowMultipleEmptyLinesInsideClassMembers" value="false" />
</module>
<module name="GenericWhitespace"/>
<module name="OperatorWrap" />
<module name="ParenPad" />
<module name="NoLineWrap" />
<module name="TypecastParenPad" />
<module name="WhitespaceAround">
<property name="tokens" value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, EQUAL, GE, GT, LAND, LCURLY, LE, LITERAL_ASSERT, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, RCURLY, SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN,TYPE_EXTENSION_AND" />
</module>
<!-- 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">
<property name="allowInSwitchCase" value="true" />
</module>
<module name="EmptyBlock">
<property name="option" value="text" />
</module>
<module name="LeftCurly" />
<module name="NeedBraces" />
<module name="RightCurly" />
<module name="EmptyCatchBlock">
<property name="exceptionVariableName" value="expected|ignore" />
</module>
<!-- Checks for common coding problems -->
<!-- See http://checkstyle.sf.net/config_coding.html -->
<!--<module name="ArrayTrailingComma" />-->
<!--<module name="AvoidInlineConditionals" />-->
<module name="CovariantEquals" />
<module name="EmptyStatement" />
<module name="EqualsHashCode" />
<!--<module name="FinalLocalVariable" />-->
<!-- DISABLED
<module name="HiddenField">
<property name="ignoreConstructorParameter" value="true" />
<property name="ignoreSetter" value="true" />
</module>
-->
<module name="IllegalInstantiation" />
<!--<module name="IllegalToken" />-->
<!--<module name="IllegalTokenText" />-->
<module name="InnerAssignment" />
<!--<module name="MagicNumber" />-->
<module name="MissingSwitchDefault" />
<!--module name="ModifiedControlVariable"/-->
<module name="NoFinalizer" />
<module name="SimplifyBooleanExpression" />
<module name="SimplifyBooleanReturn" />
<module name="StringLiteralEquality" />
<module name="NestedIfDepth">
<property name="max" value="3" />
</module>
<module name="NestedTryDepth">
<property name="max" value="3" />
</module>
<module name="NestedForDepth">
<property name="max" value="3"/>
</module>
<module name="SuperClone" />
<module name="SuperFinalize" />
<!--<module name="IllegalCatch" />-->
<module name="IllegalThrows">
<property name="illegalClassNames" value="java.lang.Error,java.lang.RuntimeException" />
</module>
<!--<module name="RedundantThrows" />-->
<module name="PackageDeclaration" />
<!-- see http://checkstyle.sourceforge.net/config_coding.html#ReturnCount -->
<module name="ReturnCount">
<property name="max" value="15" />
<property name="maxForVoid" value="15" />
</module>
<module name="IllegalType">
<property name="illegalClassNames" value="java.util.GregorianCalendar, java.util.Hashtable, java.util.HashSet, java.util.HashMap, java.util.ArrayList, java.util.LinkedList, java.util.LinkedHashMap, java.util.LinkedHashSet, java.util.TreeSet, java.util.TreeMap" />
</module>
<module name="DeclarationOrder" />
<!--<module name="ParameterAssignment" />-->
<module name="ExplicitInitialization" />
<module name="DefaultComesLast" />
<module name="MissingCtor" />
<module name="FallThrough" />
<!--<module name="MultipleStringLiterals" />-->
<module name="VariableDeclarationUsageDistance">
<property name="allowedDistance" value="8" />
</module>
<module name="MultipleVariableDeclarations" />
<!--<module name="RequireThis" />-->
<module name="UnnecessaryParentheses" />
<!-- Checks for class design -->
<!-- See http://checkstyle.sf.net/config_design.html -->
<!--<module name="DesignForExtension" />-->
<module name="FinalClass" />
<module name="HideUtilityClassConstructor" />
<module name="InterfaceIsType" />
<!--<module name="MutableException" />-->
<module name="ThrowsCount">
<property name="max" value="5" />
</module>
<module name="VisibilityModifier">
<property name="protectedAllowed" value="true" />
<property name="packageAllowed" value="true" />
<!-- this is needed for the resource injection unit tests. It will removed
when private member inject is supported.
-->
<property name="publicMemberPattern" value="resource[12].*" />
</module>
<!-- Metrics checks. -->
<!-- See http://checkstyle.sf.net/config_metrics.html -->
<module name="BooleanExpressionComplexity">
<property name="max" value="10" />
</module>
<!--<module name="ClassDataAbstractionCoupling" />-->
<!--<module name="ClassFanOutComplexity" />-->
<!--<module name="CyclomaticComplexity" />-->
<!--<module name="NPathComplexity" />-->
<module name="JavaNCSS">
<property name="methodMaximum" value="150" />
<property name="classMaximum" value="2000" />
</module>
<!-- Miscellaneous other checks. -->
<!-- See http://checkstyle.sf.net/config_misc.html -->
<!--
<module name="ArrayTypeStyle" />
<module name="FinalParameters" />
-->
<!-- DISABLED
<module name="TodoComment">
<property name="format" value="TODO" />
</module>
-->
<module name="UpperEll" />
<!--Assert statement may have side effects:-->
<module name="DescendantToken">
<property name="tokens" value="LITERAL_ASSERT" />
<property name="limitedTokens" value="ASSIGN,DEC,INC,POST_DEC,POST_INC,PLUS_ASSIGN,MINUS_ASSIGN,STAR_ASSIGN,DIV_ASSIGN,MOD_ASSIGN,BSR_ASSIGN,SR_ASSIGN,SL_ASSIGN,BAND_ASSIGN,BXOR_ASSIGN,BOR_ASSIGN" />
<property name="maximumNumber" value="0" />
</module>
<!--<module name="UncommentedMain" />-->
<!--module name="TrailingComment"/-->
<module name="Indentation">
<property name="caseIndent" value="4" />
<property name="lineWrappingIndentation" value="0" />
</module>
<!--<module name="RequiredRegexp">-->
<!-- Make the @SuppressWarnings annotations available to Checkstyle -->
<module name="SuppressWarningsHolder" />
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE\:OFF" />
<property name="onCommentFormat" value="CHECKSTYLE\:ON" />
</module>
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE.OFF\:([\w\|]+)" />
<property name="onCommentFormat" value="CHECKSTYLE.ON\:([\w\|]+)" />
<property name="checkFormat" value="$1" />
</module>
</module>
<module name="SuppressWarningsFilter" />
<!-- Header checks -->
<module name="Header">
<property name="headerFile" value="${checkstyle.header.file}"/>
<property name="fileExtensions" value="java"/>
</module>
<!-- <module name="RegexpHeader" /> -->
<module name="RegexpSingleline">
<property name="format" value="\s+$"/>
<property name="message" value="Trailing whitespace"/>
<!-- <property name="fileExtensions" value="......" /> -->
</module>
<module name="FileLength">
<property name="max" value="4096" />
</module>
<module name="FileTabCharacter">
<property name="eachLine" value="true" />
</module>
<!-- '{samedir}' is an Eclipse built in environment variable initialized with the value of the external checkstyle configuration file -->
<!-- See https://checkstyle.org/eclipse-cs/#!/properties -->
<module name="SuppressionFilter">
<property name="file" value="${samedir}/sshd-checkstyle-suppressions.xml"/>
<property name="optional" value="true"/>
</module>
</module>