|
28 | 28 | <module name="BeforeExecutionExclusionFileFilter">
|
29 | 29 | <property name="fileNamePattern" value="module\-info\.java$"/>
|
30 | 30 | </module>
|
31 |
| - <!-- https://checkstyle.org/config_filters.html#SuppressionFilter --> |
| 31 | + |
| 32 | + <module name="SuppressWarningsFilter"/> |
| 33 | + |
| 34 | + <!-- https://checkstyle.org/filters/suppressionfilter.html --> |
32 | 35 | <module name="SuppressionFilter">
|
33 |
| - <property name="file" value="checkstyle-suppressions.xml" /> |
| 36 | + <property name="file" value="${org.checkstyle.google.suppressionfilter.config}" |
| 37 | + default="checkstyle-suppressions.xml" /> |
34 | 38 | <property name="optional" value="true"/>
|
35 | 39 | </module>
|
36 | 40 |
|
37 | 41 | <!-- https://checkstyle.org/filters/suppresswithnearbytextfilter.html -->
|
38 |
| - <!--<module name="SuppressWithNearbyTextFilter"> |
| 42 | + <module name="SuppressWithNearbyTextFilter"> |
39 | 43 | <property name="nearbyTextPattern"
|
40 | 44 | value="CHECKSTYLE.SUPPRESS\: (\w+) for ([+-]\d+) lines"/>
|
41 | 45 | <property name="checkPattern" value="$1"/>
|
42 | 46 | <property name="lineRange" value="$2"/>
|
43 |
| - </module>--> |
| 47 | + </module> |
44 | 48 |
|
45 | 49 | <!-- Checks for whitespace -->
|
46 | 50 | <!-- See http://checkstyle.org/checks/whitespace/index.html -->
|
|
51 | 55 | <module name="LineLength">
|
52 | 56 | <property name="fileExtensions" value="java"/>
|
53 | 57 | <property name="max" value="120"/>
|
54 |
| - <property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/> |
| 58 | + <property name="ignorePattern" |
| 59 | + value="^package.*|^import.*|href\s*=\s*"[^"]*"|http://|https://|ftp://"/> |
55 | 60 | </module>
|
56 | 61 |
|
57 |
| - <module name="SuppressWarningsFilter" /> |
58 |
| - |
59 | 62 | <module name="TreeWalker">
|
60 |
| - <!-- needed for SuppressWarningsFilter --> |
61 |
| - <module name="SuppressWarningsHolder" /> |
62 |
| - |
63 |
| - <module name="SuppressWarnings"> |
64 |
| - <property name="id" value="checkstyle:suppresswarnings"/> |
65 |
| - </module> |
66 |
| - |
67 |
| - <!-- https://checkstyle.org/config_filters.html#SuppressionXpathFilter --> |
68 |
| - <module name="SuppressionXpathFilter"> |
69 |
| - <property name="file" value="${org.checkstyle.google.suppressionxpathfilter.config}" |
70 |
| - default="checkstyle-xpath-suppressions.xml" /> |
71 |
| - <property name="optional" value="true"/> |
72 |
| - </module> |
73 |
| - |
74 |
| - <module name="UnusedImports"/> |
75 | 63 | <module name="OuterTypeFilename"/>
|
76 | 64 | <module name="IllegalTokenText">
|
77 | 65 | <property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
|
|
98 | 86 | <property name="id" value="LeftCurlyEol"/>
|
99 | 87 | <property name="tokens"
|
100 | 88 | value="ANNOTATION_DEF, CLASS_DEF, CTOR_DEF, ENUM_CONSTANT_DEF, ENUM_DEF,
|
101 |
| - INTERFACE_DEF, LITERAL_CATCH, |
102 |
| - LITERAL_DO, LITERAL_ELSE, LITERAL_FOR, LITERAL_IF, |
103 |
| - LITERAL_WHILE, METHOD_DEF, |
| 89 | + INTERFACE_DEF, LAMBDA, LITERAL_CATCH, |
| 90 | + LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, |
| 91 | + LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, METHOD_DEF, |
104 | 92 | OBJBLOCK, STATIC_INIT, RECORD_DEF, COMPACT_CTOR_DEF"/>
|
105 | 93 | </module>
|
106 | 94 | <module name="LeftCurly">
|
107 | 95 | <property name="id" value="LeftCurlyNl"/>
|
108 | 96 | <property name="option" value="nl"/>
|
109 | 97 | <property name="tokens"
|
110 |
| - value=" LITERAL_DEFAULT"/> |
| 98 | + value="LITERAL_CASE, LITERAL_DEFAULT"/> |
111 | 99 | </module>
|
112 | 100 | <module name="SuppressionXpathSingleFilter">
|
113 |
| - <!-- LITERAL_DEFAULT are reused in SWITCH_RULE --> |
| 101 | + <!-- LITERAL_CASE, LITERAL_DEFAULT are reused in SWITCH_RULE --> |
114 | 102 | <property name="id" value="LeftCurlyNl"/>
|
115 | 103 | <property name="query" value="//SWITCH_RULE/SLIST"/>
|
116 | 104 | </module>
|
117 | 105 | <module name="RightCurly">
|
118 | 106 | <property name="id" value="RightCurlySame"/>
|
119 | 107 | <property name="tokens"
|
120 |
| - value="LITERAL_IF, LITERAL_ELSE, |
| 108 | + value="LITERAL_TRY, LITERAL_CATCH, LITERAL_IF, LITERAL_ELSE, |
121 | 109 | LITERAL_DO"/>
|
122 | 110 | </module>
|
123 | 111 | <module name="RightCurly">
|
|
126 | 114 | <property name="tokens"
|
127 | 115 | value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT,
|
128 | 116 | INSTANCE_INIT, ANNOTATION_DEF, ENUM_DEF, INTERFACE_DEF, RECORD_DEF,
|
129 |
| - COMPACT_CTOR_DEF"/> |
| 117 | + COMPACT_CTOR_DEF, LITERAL_SWITCH, LITERAL_CASE, LITERAL_FINALLY"/> |
130 | 118 | </module>
|
131 | 119 | <module name="SuppressionXpathSingleFilter">
|
132 | 120 | <!-- suppression is required till https://github.com/checkstyle/checkstyle/issues/7541 -->
|
|
136 | 124 | </module>
|
137 | 125 | <module name="WhitespaceAfter">
|
138 | 126 | <property name="tokens"
|
139 |
| - value="COMMA, SEMI, TYPECAST, LITERAL_IF, LITERAL_ELSE, |
140 |
| - LITERAL_WHILE, LITERAL_DO, LITERAL_FOR, DO_WHILE"/> |
| 127 | + value="COMMA, SEMI, TYPECAST, LITERAL_IF, LITERAL_ELSE, LITERAL_RETURN, |
| 128 | + LITERAL_WHILE, LITERAL_DO, LITERAL_FOR, LITERAL_FINALLY, DO_WHILE, ELLIPSIS, |
| 129 | + LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_CATCH, LAMBDA, |
| 130 | + LITERAL_YIELD, LITERAL_CASE, LITERAL_WHEN"/> |
141 | 131 | </module>
|
142 | 132 | <module name="WhitespaceAround">
|
143 | 133 | <property name="allowEmptyConstructors" value="true"/>
|
144 | 134 | <property name="allowEmptyLambdas" value="true"/>
|
145 | 135 | <property name="allowEmptyMethods" value="true"/>
|
146 | 136 | <property name="allowEmptyTypes" value="true"/>
|
147 | 137 | <property name="allowEmptyLoops" value="true"/>
|
148 |
| - <!--<property name="allowEmptySwitchBlockStatements" value="true"/>--> |
| 138 | + <property name="allowEmptySwitchBlockStatements" value="true"/> |
149 | 139 | <property name="ignoreEnhancedForColon" value="false"/>
|
150 | 140 | <property name="tokens"
|
151 | 141 | value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR,
|
152 |
| - BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, DO_WHILE, EQUAL, GE, GT, LAND, |
153 |
| - LCURLY, LE, LITERAL_DO, LITERAL_ELSE, |
154 |
| - LITERAL_FOR, LITERAL_IF, |
155 |
| - LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, |
| 142 | + BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, DO_WHILE, EQUAL, GE, GT, LAMBDA, LAND, |
| 143 | + LCURLY, LE, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, |
| 144 | + LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SWITCH, LITERAL_SYNCHRONIZED, |
| 145 | + LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, |
156 | 146 | NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, RCURLY, SL, SLIST, SL_ASSIGN, SR,
|
157 | 147 | SR_ASSIGN, STAR, STAR_ASSIGN, LITERAL_ASSERT,
|
158 |
| - TYPE_EXTENSION_AND"/> |
| 148 | + TYPE_EXTENSION_AND, LITERAL_WHEN"/> |
159 | 149 | <message key="ws.notFollowed"
|
160 | 150 | value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks
|
161 | 151 | may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
|
|
319 | 309 | </module>
|
320 | 310 | <module name="NoWhitespaceBeforeCaseDefaultColon"/>
|
321 | 311 | <module name="OverloadMethodsDeclarationOrder"/>
|
322 |
| - <!--<module name="ConstructorsDeclarationGrouping"/>--> |
| 312 | + <module name="ConstructorsDeclarationGrouping"/> |
323 | 313 | <module name="VariableDeclarationUsageDistance"/>
|
324 | 314 | <module name="CustomImportOrder">
|
325 | 315 | <property name="sortImportsInGroupAlphabetically" value="true"/>
|
|
329 | 319 | </module>
|
330 | 320 | <module name="MethodParamPad">
|
331 | 321 | <property name="tokens"
|
332 |
| - value="CTOR_DEF, LITERAL_NEW, METHOD_CALL, METHOD_DEF, |
333 |
| - SUPER_CTOR_CALL, ENUM_CONSTANT_DEF"/> |
| 322 | + value="CTOR_DEF, LITERAL_NEW, METHOD_CALL, METHOD_DEF, CTOR_CALL, |
| 323 | + SUPER_CTOR_CALL, ENUM_CONSTANT_DEF, RECORD_DEF, RECORD_PATTERN_DEF"/> |
334 | 324 | </module>
|
335 | 325 | <module name="NoWhitespaceBefore">
|
336 | 326 | <property name="tokens"
|
|
340 | 330 | </module>
|
341 | 331 | <module name="ParenPad">
|
342 | 332 | <property name="tokens"
|
343 |
| - value="ANNOTATION, ANNOTATION_FIELD_DEF, CTOR_DEF, DOT, ENUM_CONSTANT_DEF, |
344 |
| - EXPR, LITERAL_DO, LITERAL_FOR, LITERAL_IF, LITERAL_NEW, |
345 |
| - LITERAL_WHILE, METHOD_CALL, |
346 |
| - METHOD_DEF, QUESTION, RESOURCE_SPECIFICATION, SUPER_CTOR_CALL"/> |
| 333 | + value="ANNOTATION, ANNOTATION_FIELD_DEF, CTOR_CALL, CTOR_DEF, DOT, ENUM_CONSTANT_DEF, |
| 334 | + EXPR, LITERAL_CATCH, LITERAL_DO, LITERAL_FOR, LITERAL_IF, LITERAL_NEW, |
| 335 | + LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_WHILE, METHOD_CALL, |
| 336 | + METHOD_DEF, QUESTION, RESOURCE_SPECIFICATION, SUPER_CTOR_CALL, LAMBDA, |
| 337 | + RECORD_DEF, RECORD_PATTERN_DEF"/> |
347 | 338 | </module>
|
348 | 339 | <module name="OperatorWrap">
|
349 | 340 | <property name="option" value="NL"/>
|
|
371 | 362 | value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
|
372 | 363 | </module>
|
373 | 364 | <module name="JavadocParagraph">
|
| 365 | + <property name="allowNewlineParagraph" value="false"/> |
374 | 366 | </module>
|
375 | 367 | <module name="RequireEmptyLineBeforeBlockTagGroup"/>
|
376 | 368 | <module name="AtclauseOrder">
|
|
0 commit comments