-
Notifications
You must be signed in to change notification settings - Fork 1
/
checkstyle.xml
279 lines (250 loc) · 11.2 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
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
<?xml version="1.0" encoding="UTF-8"?><!--
~ @Copyright 2020 HardBackNutter
~ @License GNU General Public License
~
~ This file is part of SshRemote.
~
~ SshRemote is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ SshRemote is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
~ See the GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with SshRemote. If not, see <http://www.gnu.org/licenses/>.
-->
<!DOCTYPE module PUBLIC "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"http://checkstyle.org/dtds/configuration_1_3.dtd"><!--
Docs: https://checkstyle.org/checks.html
Template:
should match: https://source.android.com/setup/contribute/code-style
copied from: https://gist.github.com/shareme/4197561
-->
<module name="Checker">
<property name="severity" value="warning" />
<!-- workaround for CheckStyle issue #483 -->
<property name="charset" value="UTF-8" />
<!-- ========== Headers ========== -->
<!--<module name="Header"/>-->
<!--<module name="RegexpHeader"/>-->
<!-- Checks that each Java package has a package-info.java file -->
<module name="JavadocPackage" />
<!-- Require files to end with newline characters -->
<module name="NewlineAtEndOfFile">
<!-- <property name="lineSeparator"-->
<!-- value="lf" />-->
</module>
<!-- Checks for long source files. (default 2000 lines) -->
<module name="FileLength" />
<module name="LineLength">
<property name="max" value="100" />
</module>
<!-- Checks that there are no tab characters -->
<module name="FileTabCharacter" />
<!--<module name="RegexpMultiline" />-->
<!-- A check for detecting single lines that match a supplied regular expression. -->
<module name="RegexpSingleline">
<property name="severity" value="ignore" />
<property name="format" value="\s+$" />
<property name="message" value="Line has trailing spaces." />
</module>
<!--<module name="RegexpOnFilename"/>-->
<!--<module name="Translation" />-->
<module name="UniqueProperties" />
<module name="TreeWalker">
<property name="tabWidth" value="4" />
<!-- ========== Annotations ========== -->
<module name="AnnotationLocation" />
<!--<module name="AnnotationOnSameLine" />-->
<module name="AnnotationUseStyle" />
<module name="MissingDeprecated" />
<module name="MissingOverride" />
<module name="PackageAnnotation" />
<module name="SuppressWarnings" />
<!--<module name="SuppressWarningsHolder" />-->
<!-- ========== Block Checks ========== -->
<!-- a switch with nested blocks can be collapsed/expanded in the editor. Useful. -->
<!-- <module name="AvoidNestedBlocks" />-->
<module name="EmptyBlock" />
<module name="EmptyCatchBlock" />
<module name="LeftCurly" />
<module name="NeedBraces" />
<module name="RightCurly" />
<!-- ========== Class Design ========== -->
<!--<module name="DesignForExtension" />-->
<module name="FinalClass" />
<module name="HideUtilityClassConstructor" />
<module name="InnerTypeLast" />
<module name="InterfaceIsType" />
<module name="MutableException" />
<module name="OneTopLevelClass" />
<module name="ThrowsCount">
<property name="max" value="6" />
</module>
<module name="VisibilityModifier" />
<!-- ========== Coding ========== -->
<module name="ArrayTrailingComma" />
<module name="AvoidInlineConditionals" />
<module name="CovariantEquals" />
<!--<module name="DeclarationOrder"/>-->
<module name="DefaultComesLast" />
<module name="EmptyStatement" />
<module name="EqualsAvoidNull" />
<module name="EqualsHashCode" />
<module name="ExplicitInitialization" />
<module name="FallThrough" />
<module name="FinalLocalVariable">
<!--<property name="tokens" value="VARIABLE_DEF,PARAMETER_DEF"/>-->
<property name="tokens" value="PARAMETER_DEF" />
</module>
<module name="HiddenField" />
<module name="IllegalCatch" />
<module name="IllegalInstantiation" />
<module name="IllegalThrows" />
<module name="IllegalToken" />
<!--<module name="IllegalTokenText" />-->
<module name="IllegalType" />
<module name="InnerAssignment" />
<module name="MagicNumber" />
<!--<module name="MissingCtor" />-->
<module name="MissingSwitchDefault" />
<module name="ModifiedControlVariable" />
<module name="MultipleStringLiterals" />
<module name="MultipleVariableDeclarations" />
<!--<module name="NestedForDepth"/>-->
<!--<module name="NestedIfDepth"/>-->
<module name="NoClone" />
<module name="NoFinalizer" />
<module name="OneStatementPerLine" />
<module name="OverloadMethodsDeclarationOrder" />
<module name="ParameterAssignment" />
<!--<module name="RequireThis"/>-->
<module name="ReturnCount">
<property name="max" value="3" />
<property name="maxForVoid" value="5" />
</module>
<module name="SimplifyBooleanExpression" />
<module name="SimplifyBooleanReturn" />
<module name="StringLiteralEquality" />
<module name="SuperClone" />
<module name="SuperFinalize" />
<module name="UnnecessaryParentheses" />
<!--<module name="VariableDeclarationUsageDistance"/>-->
<!-- ========== Imports ========== -->
<module name="AvoidStarImport" />
<module name="AvoidStaticImport" />
<!--<module name="CustomImportOrder" />-->
<module name="IllegalImport" />
<!--<module name="ImportControl" />-->
<!--<module name="ImportOrder" />-->
<module name="RedundantImport" />
<module name="UnusedImports" />
<!-- ========== Javadoc Comments ========== -->
<!--<module name="AtclauseOrder" />-->
<module name="JavadocMethod">
<property name="validateThrows" value="true" />
</module>
<!--<module name="JavadocParagraph"/>-->
<!--<module name="JavadocTagContinuationIndentation" />-->
<!--<module name="JavadocStyle" />-->
<module name="JavadocType" />
<module name="JavadocVariable" />
<module name="NonEmptyAtclauseDescription" />
<module name="SingleLineJavadoc" />
<module name="SummaryJavadocCheck" />
<!-- ========== Metrics ========== -->
<module name="BooleanExpressionComplexity" />
<!-- Measures the number of instantiations of other classes within the given class. -->
<module name="ClassDataAbstractionCoupling" />
<!-- Checks the number of other classes a given class relies on. -->
<module name="ClassFanOutComplexity">
<property name="excludedPackages" value="java, android, androidx" />
</module>
<!-- a measure of the minimum number of possible paths through the source and
therefore the number of required tests. -->
<module name="CyclomaticComplexity" />
<!-- Rationale: Too large methods and classes are hard to read and costly to maintain.
A large NCSS number often means that a method or class has too many responsibilities
which should be decomposed into smaller units. -->
<module name="JavaNCSS" />
<!-- The NPATH metric computes the number of possible execution paths through a function.
-->
<module name="NPathComplexity">
<property name="max" value="5000" />
</module>
<!-- ========== Miscellaneous ========== -->
<module name="ArrayTypeStyle" />
<!--<module name="AvoidEscapedUnicodeCharacters"/>-->
<module name="CommentsIndentation" />
<!--<module name="DescendantToken" />-->
<module name="FinalParameters" />
<!-- Useful, but cannot use 'align' of parameters etc when enabled -->
<!--<module name="Indentation" />-->
<!--<module name="OuterTypeFilename"/>-->
<!--<module name="TodoComment" />-->
<module name="TrailingComment" />
<module name="UpperEll" />
<!-- ========== Modifiers ========== -->
<!--<module name="ClassMemberImpliedModifier" />-->
<!--<module name="InterfaceMemberImpliedModifier"/>-->
<module name="ModifierOrder" />
<module name="RedundantModifier" />
<!-- ========== Naming Conventions ========== -->
<module name="AbbreviationAsWordInName" />
<!--<module name="AbstractClassName" />-->
<!--<module name="CatchParameterName" />-->
<!--<module name="ClassTypeParameterName" />-->
<module name="ConstantName" />
<!--<module name="InterfaceTypeParameterName" />-->
<module name="LambdaParameterName" />
<module name="LocalFinalVariableName" />
<module name="LocalVariableName" />
<module name="MemberName" />
<module name="MethodName" />
<module name="MethodTypeParameterName" />
<module name="PackageName" />
<module name="ParameterName" />
<module name="StaticVariableName" />
<module name="TypeName" />
<!-- ========== Regexp ========== -->
<!--<module name="Regexp" />-->
<!--<module name="RegexpSinglelineJava" />-->
<!-- ========== Size Violations ========== -->
<module name="AnonInnerLength">
<property name="max" value="30" />
</module>
<!--<module name="ExecutableStatementCount"/>-->
<!--<module name="FileLength" /> on top-level -->
<module name="MethodCount" />
<module name="MethodLength" />
<module name="OuterTypeNumber" />
<module name="ParameterNumber" />
<!-- ========== Whitespace ========== -->
<!--<module name="EmptyForInitializerPad"/>-->
<module name="EmptyForIteratorPad" />
<!--<module name="EmptyLineSeparator"/>-->
<module name="GenericWhitespace" />
<module name="MethodParamPad" />
<module name="NoLineWrap" />
<module name="NoWhitespaceAfter" />
<module name="NoWhitespaceBefore" />
<module name="OperatorWrap" />
<module name="ParenPad" />
<module name="SeparatorWrap">
<property name="tokens" value="DOT" />
<property name="option" value="nl" />
</module>
<module name="SeparatorWrap">
<property name="tokens" value="COMMA" />
<property name="option" value="eol" />
</module>
<module name="SingleSpaceSeparator" />
<module name="TypecastParenPad" />
<module name="WhitespaceAfter" />
<module name="WhitespaceAround" />
</module>
</module>