Skip to content

Commit 17049f6

Browse files
committed
IGNITE-26775 Improved suppressions
1 parent 61a4b96 commit 17049f6

4 files changed

Lines changed: 79 additions & 29 deletions

File tree

checkstyle/checkstyle-suppressions.xml

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,49 @@
2323
<suppressions>
2424
<suppress checks="RightCurly|LeftCurly|EmptyLineSeparator|MethodParamPad|SingleSpaceSeparator"
2525
files="BCrypt\.java|ConcurrentLinkedDeque8\.java"/>
26-
<suppress checks="NoWhitespaceBefore" files="ConcurrentLinkedHashMap\.java"/>
26+
27+
<suppress checks="NoWhitespaceBefore"
28+
files="ConcurrentLinkedHashMap\.java"/>
29+
2730
<suppress checks="LineLength"
2831
files="ClusterTagGenerator\.java|PagesWriteSpeedBasedThrottle\.java|GridExecutorService\.java|CatboostClassificationModel\.java|classnames\.properties"/>
32+
33+
<suppress checks="(?&lt;!Missing)JavadocMethod"
34+
files="[\\/]internal[\\/]"/>
35+
36+
<suppress checks="(?&lt;!Missing)JavadocMethod"
37+
files="[\\/]test[\\/]"/>
38+
39+
<suppress checks="(?&lt;!Missing)JavadocMethod"
40+
files="[\\/]tests[\\/]"/>
41+
42+
<suppress checks="(?&lt;!Missing)JavadocMethod"
43+
files="[\\/]ml[\\/]"/>
44+
45+
<suppress checks="(?&lt;!Missing)JavadocMethod"
46+
files="[\\/]yardstick[\\/]"/>
47+
48+
<suppress checks="Javadoc"
49+
files="BCrypt\.java|HLL\.java|HLLMetadata\.java|HLLType\.java|BigEndianAscendingWordSerializer\.java|NumberUtil\.java|SchemaVersionOne\.java|BigEndianAscendingWordDeserializer\.java|CacheView\.java|ConcurrentLinkedDeque8\.java|ConcurrentHashMap8\.java|ConcurrentLinkedHashMap\.java"/>
50+
51+
<suppress checks="org.apache.ignite.tools.checkstyle.ClassUsageRestrictionRule"
52+
files="[\\/]yardstick[\\/]"/>
53+
54+
<suppress checks="org.apache.ignite.tools.checkstyle.ClassUsageRestrictionRule"
55+
files="[\\/]internal[\\/]thread[\\/]"/>
56+
57+
<suppress checks="org.apache.ignite.tools.checkstyle.ClassUsageRestrictionRule"
58+
files="[\\/]internal[\\/]jdbc[\\/]thin[\\/]"/>
59+
60+
<suppress checks="org.apache.ignite.tools.checkstyle.ClassUsageRestrictionRule"
61+
files="[\\/]internal[\\/]client[\\/]"/>
62+
63+
<suppress checks="org.apache.ignite.tools.checkstyle.ClassUsageRestrictionRule"
64+
files="[\\/]io[\\/]opencensus[\\/]"/>
65+
66+
<suppress checks="org.apache.ignite.tools.checkstyle.ClassUsageRestrictionRule"
67+
files="[\\/]test[\\/]|[\\/]tests[\\/]"/>
68+
69+
<suppress checks="org.apache.ignite.tools.checkstyle.ClassUsageRestrictionRule"
70+
files="DumpReader\.java|CacheLoadOnlyStoreAdapter\.java"/>
2971
</suppressions>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0"?>
2+
3+
<!--
4+
Licensed to the Apache Software Foundation (ASF) under one or more
5+
contributor license agreements. See the NOTICE file distributed with
6+
this work for additional information regarding copyright ownership.
7+
The ASF licenses this file to You under the Apache License, Version 2.0
8+
(the "License"); you may not use this file except in compliance with
9+
the License. You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.
18+
-->
19+
20+
<!DOCTYPE suppressions PUBLIC
21+
"-//Checkstyle//DTD SuppressionXpathFilter Experimental Configuration 1.2//EN"
22+
"https://checkstyle.org/dtds/suppressions_1_2_xpath_experimental.dtd">
23+
<suppressions>
24+
<suppress-xpath checks="AnnotationOnSameLine"
25+
query="//ANNOTATION[.//IDENT[not(@text='Override')]]"/>
26+
</suppressions>

checkstyle/checkstyle.xml

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424

2525
<property name="fileExtensions" value="java, properties, xml"/>
2626

27+
<module name="SuppressionFilter">
28+
<property name="file" value="checkstyle/checkstyle-suppressions.xml"/>
29+
</module>
30+
2731
<!-- Whitespaces Checks. See: http://checkstyle.sourceforge.net/config_whitespace.html -->
2832
<module name="FileTabCharacter">
2933
<property name="eachLine" value="true"/>
@@ -33,6 +37,10 @@
3337
<module name="NewlineAtEndOfFile"/>
3438

3539
<module name="TreeWalker">
40+
<module name="SuppressionXpathFilter">
41+
<property name="file" value="checkstyle/checkstyle-xpath-suppressions.xml"/>
42+
</module>
43+
3644
<!-- Coding Checks. See: https://checkstyle.sourceforge.io/config_coding.html -->
3745
<module name="SimplifyBooleanExpression"/>
3846

@@ -82,10 +90,7 @@
8290

8391
<!-- @Override annotations on the same line with a method declaration check. -->
8492
<module name="AnnotationOnSameLine" />
85-
<module name="SuppressionXpathSingleFilter">
86-
<property name="checks" value="AnnotationOnSameLine" />
87-
<property name="query" value="//ANNOTATION[.//IDENT[not(@text='Override')]]" />
88-
</module>
93+
8994
<!--
9095
Checks the padding between the identifier of a method definition, constructor definition, method call, or
9196
constructor invocation; and the left parenthesis of the parameter list.
@@ -166,24 +171,6 @@
166171
-->
167172
<module name="JavadocVariable"/>
168173

169-
<!--
170-
Suppresses MissingJavadocMethod check violations in the specified packages.
171-
See: https://checkstyle.sourceforge.io/config_filters.html#SuppressionXpathSingleFilter
172-
-->
173-
<module name="SuppressionXpathSingleFilter">
174-
<property name="checks" value="(?&lt;!Missing)JavadocMethod"/>
175-
<property name="files" value="[\\/]internal[\\/]|[\\/]test[\\/]|[\\/]tests[\\/]|[\\/]ml[\\/]|[\\/]yardstick[\\/]"/>
176-
</module>
177-
178-
<!--
179-
Suppresses all Javadoc check violations in the specified files.
180-
See: https://checkstyle.sourceforge.io/config_filters.html#SuppressionXpathSingleFilter
181-
-->
182-
<module name="SuppressionXpathSingleFilter">
183-
<property name="checks" value="Javadoc"/>
184-
<property name="files" value="BCrypt\.java|HLL\.java|HLLMetadata\.java|HLLType\.java|BigEndianAscendingWordSerializer\.java|NumberUtil\.java|SchemaVersionOne\.java|BigEndianAscendingWordDeserializer\.java|CacheView\.java|ConcurrentLinkedDeque8\.java|ConcurrentHashMap8\.java|ConcurrentLinkedHashMap\.java"/>
185-
</module>
186-
187174
<module name="Indentation" />
188175

189176
<module name="LeftCurly"/>
@@ -195,6 +182,7 @@
195182
<!-- Usage of Ignite abbrevations check. -->
196183
<module name="org.apache.ignite.tools.checkstyle.IgniteAbbrevationsRule"/>
197184

185+
<!-- Prevents usage of the particular Java classes in Ignite codebase. -->
198186
<module name="org.apache.ignite.tools.checkstyle.ClassUsageRestrictionRule">
199187
<property name="className" value="java.util.concurrent.ForkJoinPool"/>
200188
<property name="factoryMethods" value="commonPool"/>
@@ -222,11 +210,6 @@
222210
<property name="className" value="java.util.concurrent.ScheduledThreadPoolExecutor"/>
223211
<property name="substitutionClassName" value="org.apache.ignite.internal.thread.pool.IgniteScheduledThreadPoolExecutor"/>
224212
</module>
225-
226-
<module name="SuppressionXpathSingleFilter">
227-
<property name="checks" value="org.apache.ignite.tools.checkstyle.ClassUsageRestrictionRule"/>
228-
<property name="files" value="[\\/]org[\\/]apache[\\/]ignite[\\/]yardstick[\\/]|[\\/]org[\\/]apache[\\/]ignite[\\/]internal[\\/]thread[\\/]|[\\/]jdbc[\\/]thin[\\/]|[\\/]test[\\/]|[\\/]tests[\\/]|[\\/]internal[\\/]client[\\/]|[\\/]io[\\/]opencensus[\\/]|DumpReader\.java|CacheLoadOnlyStoreAdapter\.java"/>
229-
</module>
230213
</module>
231214

232215
<!--

parent/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@
217217
<outputFile>${project.build.directory}/checkstyle-result.xml</outputFile>
218218
<!-- This configuration checkstyle files will be obtained from the 'ignite-checkstyle' resources. -->
219219
<configLocation>checkstyle/checkstyle.xml</configLocation>
220-
<suppressionsLocation>checkstyle/checkstyle-suppressions.xml</suppressionsLocation>
221220
<includeTestSourceDirectory>true</includeTestSourceDirectory>
222221
<excludes>**/generated/**/*</excludes>
223222
</configuration>

0 commit comments

Comments
 (0)