Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 43 additions & 1 deletion checkstyle/checkstyle-suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,49 @@
<suppressions>
<suppress checks="RightCurly|LeftCurly|EmptyLineSeparator|MethodParamPad|SingleSpaceSeparator"
files="BCrypt\.java|ConcurrentLinkedDeque8\.java"/>
<suppress checks="NoWhitespaceBefore" files="ConcurrentLinkedHashMap\.java"/>

<suppress checks="NoWhitespaceBefore"
files="ConcurrentLinkedHashMap\.java"/>

<suppress checks="LineLength"
files="ClusterTagGenerator\.java|PagesWriteSpeedBasedThrottle\.java|GridExecutorService\.java|CatboostClassificationModel\.java|classnames\.properties"/>

<suppress checks="(?&lt;!Missing)JavadocMethod"
files="[\\/]internal[\\/]"/>

<suppress checks="(?&lt;!Missing)JavadocMethod"
files="[\\/]test[\\/]"/>

<suppress checks="(?&lt;!Missing)JavadocMethod"
files="[\\/]tests[\\/]"/>

<suppress checks="(?&lt;!Missing)JavadocMethod"
files="[\\/]ml[\\/]"/>

<suppress checks="(?&lt;!Missing)JavadocMethod"
files="[\\/]yardstick[\\/]"/>

<suppress checks="Javadoc"
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"/>

<suppress checks="org.apache.ignite.tools.checkstyle.ClassUsageRestrictionRule"
files="[\\/]yardstick[\\/]"/>

<suppress checks="org.apache.ignite.tools.checkstyle.ClassUsageRestrictionRule"
files="[\\/]internal[\\/]thread[\\/]"/>

<suppress checks="org.apache.ignite.tools.checkstyle.ClassUsageRestrictionRule"
files="[\\/]internal[\\/]jdbc[\\/]thin[\\/]"/>

<suppress checks="org.apache.ignite.tools.checkstyle.ClassUsageRestrictionRule"
files="[\\/]internal[\\/]client[\\/]"/>

<suppress checks="org.apache.ignite.tools.checkstyle.ClassUsageRestrictionRule"
files="[\\/]io[\\/]opencensus[\\/]"/>

<suppress checks="org.apache.ignite.tools.checkstyle.ClassUsageRestrictionRule"
files="[\\/]test[\\/]|[\\/]tests[\\/]"/>

<suppress checks="org.apache.ignite.tools.checkstyle.ClassUsageRestrictionRule"
files="DumpReader\.java|CacheLoadOnlyStoreAdapter\.java"/>
</suppressions>
26 changes: 26 additions & 0 deletions checkstyle/checkstyle-xpath-suppressions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0"?>

<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<!DOCTYPE suppressions PUBLIC
"-//Checkstyle//DTD SuppressionXpathFilter Experimental Configuration 1.2//EN"
"https://checkstyle.org/dtds/suppressions_1_2_xpath_experimental.dtd">
<suppressions>
<suppress-xpath checks="AnnotationOnSameLine"
query="//ANNOTATION[.//IDENT[not(@text='Override')]]"/>
</suppressions>
62 changes: 40 additions & 22 deletions checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@

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

<!-- Suppressions. See: https://checkstyle.sourceforge.io/filters/suppressionfilter.html -->
<module name="SuppressionFilter">
<property name="file" value="checkstyle/checkstyle-suppressions.xml"/>
</module>

<!-- Whitespaces Checks. See: http://checkstyle.sourceforge.net/config_whitespace.html -->
<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
Expand All @@ -39,6 +44,11 @@
</module>

<module name="TreeWalker">
<!-- Suppressions. See: https://checkstyle.sourceforge.io/filters/suppressionxpathfilter.html -->
<module name="SuppressionXpathFilter">
<property name="file" value="checkstyle/checkstyle-xpath-suppressions.xml"/>
</module>

<!-- Coding Checks. See: https://checkstyle.sourceforge.io/config_coding.html -->
<module name="SimplifyBooleanExpression"/>

Expand Down Expand Up @@ -88,10 +98,7 @@

<!-- @Override annotations on the same line with a method declaration check. -->
<module name="AnnotationOnSameLine" />
<module name="SuppressionXpathSingleFilter">
<property name="checks" value="AnnotationOnSameLine" />
<property name="query" value="//ANNOTATION[.//IDENT[not(@text='Override')]]" />
</module>

<!--
Checks the padding between the identifier of a method definition, constructor definition, method call, or
constructor invocation; and the left parenthesis of the parameter list.
Expand Down Expand Up @@ -172,24 +179,6 @@
-->
<module name="JavadocVariable"/>

<!--
Suppresses MissingJavadocMethod check violations in the specified packages.
See: https://checkstyle.sourceforge.io/config_filters.html#SuppressionXpathSingleFilter
-->
<module name="SuppressionXpathSingleFilter">
<property name="checks" value="(?&lt;!Missing)JavadocMethod"/>
<property name="files" value="[\\/]internal[\\/]|[\\/]test[\\/]|[\\/]tests[\\/]|[\\/]ml[\\/]|[\\/]yardstick[\\/]"/>
</module>

<!--
Suppresses all Javadoc check violations in the specified files.
See: https://checkstyle.sourceforge.io/config_filters.html#SuppressionXpathSingleFilter
-->
<module name="SuppressionXpathSingleFilter">
<property name="checks" value="Javadoc"/>
<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"/>
</module>

<module name="Indentation" />

<module name="LeftCurly"/>
Expand All @@ -200,6 +189,35 @@

<!-- Usage of Ignite abbrevations check. -->
<module name="org.apache.ignite.tools.checkstyle.IgniteAbbrevationsRule"/>

<!-- Prevents usage of the particular Java classes in Ignite codebase. -->
<module name="org.apache.ignite.tools.checkstyle.ClassUsageRestrictionRule">
<property name="className" value="java.util.concurrent.ForkJoinPool"/>
<property name="factoryMethods" value="commonPool"/>
<property name="substitutionClassName" value="org.apache.ignite.internal.thread.pool.IgniteForkJoinPool"/>
</module>

<module name="org.apache.ignite.tools.checkstyle.ClassUsageRestrictionRule">
<property name="className" value="java.util.concurrent.Executors"/>
<property name="factoryMethods" value="newFixedThreadPool, newWorkStealingPool, newSingleThreadExecutor, newCachedThreadPool, unconfigurableExecutorService"/>
<property name="substitutionClassName" value="org.apache.ignite.internal.thread.IgniteThreadPoolExecutor"/>
</module>

<module name="org.apache.ignite.tools.checkstyle.ClassUsageRestrictionRule">
<property name="className" value="java.util.concurrent.Executors"/>
<property name="factoryMethods" value="newSingleThreadScheduledExecutor, newScheduledThreadPool, unconfigurableScheduledExecutorService"/>
<property name="substitutionClassName" value="org.apache.ignite.internal.thread.pool.IgniteScheduledThreadPoolExecutor"/>
</module>

<module name="org.apache.ignite.tools.checkstyle.ClassUsageRestrictionRule">
<property name="className" value="java.util.concurrent.ThreadPoolExecutor"/>
<property name="substitutionClassName" value="org.apache.ignite.internal.thread.IgniteThreadPoolExecutor"/>
</module>

<module name="org.apache.ignite.tools.checkstyle.ClassUsageRestrictionRule">
<property name="className" value="java.util.concurrent.ScheduledThreadPoolExecutor"/>
<property name="substitutionClassName" value="org.apache.ignite.internal.thread.pool.IgniteScheduledThreadPoolExecutor"/>
</module>
</module>

<!--
Expand Down
8 changes: 8 additions & 0 deletions modules/checkstyle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@
<version>${checkstyle.puppycrawl.version}</version>
</dependency>

<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>${checkstyle.puppycrawl.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down
Loading
Loading