|
1 | | -<?xml version="1.0"?> |
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
2 | 2 | <!DOCTYPE module PUBLIC |
3 | | - "-//Puppy Crawl//DTD Check Configuration 1.3//EN" |
4 | | - "http://www.puppycrawl.com/dtds/configuration_1_3.dtd"> |
| 3 | + "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" |
| 4 | + "https://checkstyle.org/dtds/configuration_1_3.dtd"> |
5 | 5 |
|
6 | 6 | <!-- |
7 | 7 |
|
|
20 | 20 | - some best practices |
21 | 21 |
|
22 | 22 | Checkstyle is very configurable. Be sure to read the documentation at |
23 | | - https://checkstyle.sourceforge.io/ (or in your downloaded distribution). |
| 23 | + https://checkstyle.org (or in your downloaded distribution). |
24 | 24 |
|
25 | 25 | Most Checks are configurable, be sure to consult the documentation. |
26 | 26 |
|
27 | 27 | To completely disable a check, just comment it out or delete it from the file. |
| 28 | + To suppress certain violations please review suppression filters. |
28 | 29 |
|
29 | 30 | Finally, it is worth reading the documentation. |
30 | 31 |
|
|
44 | 45 |
|
45 | 46 | <!-- Part of turning off individual checks: --> |
46 | 47 | <!-- https://stackoverflow.com/questions/4023185/disable-a-particular-checkstyle-rule-for-a-particular-line-of-code --> |
47 | | - <module name="SuppressWarningsFilter" /> |
| 48 | + <module name="SuppressWarningsFilter"/> |
48 | 49 |
|
49 | 50 | <!-- Checks that a package-info.java file exists for each package. --> |
50 | 51 | <!-- See https://checkstyle.sourceforge.io/config_javadoc.html#JavadocPackage --> |
|
63 | 64 | <!-- Checks for Size Violations. --> |
64 | 65 | <!-- See https://checkstyle.sourceforge.io/config_sizes.html --> |
65 | 66 | <module name="FileLength"> |
66 | | - <property name="max" value="1600"/> |
| 67 | + <property name="max" value="850"/> |
67 | 68 | </module> |
68 | 69 |
|
69 | 70 | <module name="LineLength"> |
|
83 | 84 | <property name="message" value="Line has trailing spaces."/> |
84 | 85 | </module> |
85 | 86 |
|
86 | | - <!-- Checks for Headers --> |
87 | | - <!-- See http://checkstyle.sf.net/config_header.html --> |
88 | | - <!-- <module name="Header"> --> |
89 | | - <!-- <property name="headerFile" value="${checkstyle.header.file}"/> --> |
90 | | - <!-- <property name="fileExtensions" value="java"/> --> |
91 | | - <!-- </module> --> |
| 87 | + <!-- Checks for Headers --> |
| 88 | + <!-- See https://checkstyle.sourceforge.io/config_header.html --> |
| 89 | + <module name="Header"> |
| 90 | + <property name="headerFile" value="${config_loc}/javaHeader.txt"/> |
| 91 | + <property name="fileExtensions" value="java"/> |
| 92 | + </module> |
92 | 93 |
|
93 | 94 | <module name="TreeWalker"> |
94 | 95 |
|
95 | 96 | <!-- Part of turning off individual checks: --> |
96 | 97 | <!-- https://stackoverflow.com/questions/5761188/checkstyle-suppressioncommentfilter-not-ignoring-specified-rule/5764666#5764666 --> |
97 | | - <module name="SuppressWarningsHolder" /> |
| 98 | + <module name="SuppressWarningsHolder"/> |
98 | 99 |
|
99 | 100 | <!-- Checks for Javadoc comments. --> |
100 | 101 | <!-- See https://checkstyle.sourceforge.io/config_javadoc.html --> |
|
145 | 146 | <module name="MissingDeprecated"/> |
146 | 147 | <module name="MissingOverride"/> |
147 | 148 |
|
148 | | - <!-- Checks for imports --> |
| 149 | + <!-- Checks for imports --> |
149 | 150 | <!-- See https://checkstyle.sourceforge.io/config_imports.html --> |
150 | 151 | <!--<module name="AvoidStarImport"/>--> |
151 | 152 | <module name="IllegalImport"/> <!-- defaults to sun.* packages --> |
152 | 153 | <module name="RedundantImport"/> |
153 | 154 | <module name="UnusedImports"/> |
154 | 155 |
|
155 | 156 |
|
156 | | - <!-- Checks for Size Violations. --> |
157 | | - <!-- See https://checkstyle.sourceforge.io/config_imports.html --> |
| 157 | + <!-- Checks for Size Violations. --> |
| 158 | + <!-- See https://checkstyle.sourceforge.io/config_sizes.html --> |
158 | 159 | <module name="MethodLength"> |
159 | 160 | <property name="max" value="300"/> |
160 | 161 | </module> |
161 | 162 | <module name="ParameterNumber"> |
162 | | - <property name="max" value="9"/> |
| 163 | + <property name="max" value="7"/> |
163 | 164 | <!--<property name="ignoreOverriddenMethods" value="true"/>--> |
164 | 165 | </module> |
165 | 166 |
|
|
211 | 212 | <property name="ignoreConstructorParameter" value="true" /> |
212 | 213 | </module> |
213 | 214 | --> |
214 | | -<!-- <module name="IllegalCatch"/>--> |
| 215 | + <!-- <module name="IllegalCatch"/>--> |
215 | 216 | <module name="IllegalInstantiation"/> |
216 | 217 | <module name="IllegalThrows"/> |
217 | 218 | <module name="IllegalType"/> |
218 | | - <!--<module name="InnerAssignment"/> --> |
219 | | - <!--<module name="MagicNumber"/> Unfortunately, too much noise --> |
220 | | - <!--<module name="MissingSwitchDefault"/>--> |
| 219 | + <!--<module name="InnerAssignment"/> --> |
| 220 | + <!--<module name="MagicNumber"/> Unfortunately, too much noise --> |
| 221 | + <!--<module name="MissingSwitchDefault"/>--> |
221 | 222 | <module name="MultipleVariableDeclarations"/> |
222 | 223 | <module name="SimplifyBooleanExpression"/> |
223 | 224 | <module name="SimplifyBooleanReturn"/> |
224 | 225 | <!-- <module name="UnnecessaryParentheses"/>--> |
225 | | - <module name="UnnecessarySemicolonAfterTypeMemberDeclaration"/> |
226 | 226 | <module name="UnnecessarySemicolonAfterOuterTypeDeclaration"/> |
| 227 | + <module name="UnnecessarySemicolonAfterTypeMemberDeclaration"/> |
227 | 228 | <module name="UnnecessarySemicolonInEnumeration"/> |
228 | 229 | <module name="UnnecessarySemicolonInTryWithResources"/> |
229 | 230 | <module name="UnusedLocalVariable"/> |
|
251 | 252 |
|
252 | 253 | <!-- Checks for metrics. --> |
253 | 254 | <!-- See https://checkstyle.sourceforge.io/config_metrics.html --> |
254 | | - <!-- <module name="CyclomaticComplexity"/>--> |
| 255 | + <module name="CyclomaticComplexity"> |
| 256 | + <property name="switchBlockAsSingleDecisionPoint" value="true"/> |
| 257 | + </module> |
255 | 258 | </module> |
256 | 259 |
|
257 | 260 | <module name="Translation"> |
|
0 commit comments