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
7 changes: 7 additions & 0 deletions hadoop-hdds/annotations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@
<proc>none</proc>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<suppressionsLocation>${basedir}/../../hadoop-hdds/dev-support/checkstyle/suppressions-skip-imports.xml</suppressionsLocation>
</configuration>
</plugin>
</plugins>
</build>
</project>
7 changes: 7 additions & 0 deletions hadoop-hdds/client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,13 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<suppressionsLocation>${basedir}/../../hadoop-hdds/dev-support/checkstyle/suppressions-skip-imports.xml</suppressionsLocation>
</configuration>
</plugin>
</plugins>
</build>
</project>
7 changes: 7 additions & 0 deletions hadoop-hdds/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,13 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<suppressionsLocation>${basedir}/../../hadoop-hdds/dev-support/checkstyle/suppressions-skip-imports.xml</suppressionsLocation>
</configuration>
</plugin>
</plugins>
<extensions>
<extension>
Expand Down
7 changes: 7 additions & 0 deletions hadoop-hdds/config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<suppressionsLocation>${basedir}/../../hadoop-hdds/dev-support/checkstyle/suppressions-skip-imports.xml</suppressionsLocation>
</configuration>
</plugin>
</plugins>
</build>
</project>
7 changes: 7 additions & 0 deletions hadoop-hdds/container-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,13 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<suppressionsLocation>${basedir}/../../hadoop-hdds/dev-support/checkstyle/suppressions-skip-imports.xml</suppressionsLocation>
</configuration>
</plugin>
</plugins>
</build>
</project>
82 changes: 30 additions & 52 deletions hadoop-hdds/dev-support/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.2//EN"
"https://checkstyle.org/dtds/configuration_1_2.dtd">
"-//Checkstyle//DTD Checkstyle Configuration 1.2//EN"
"https://checkstyle.org/dtds/configuration_1_2.dtd">

<!--
Licensed to the Apache Software Foundation (ASF) under one or more
Expand All @@ -20,7 +20,6 @@
limitations under the License.
-->
<!--

Checkstyle configuration for Hadoop HDDS that is based on the sun_checks.xml file
that is bundled with Checkstyle and includes checks for:

Expand All @@ -44,13 +43,16 @@
To completely disable a check, just comment it out or delete it from the file.

Finally, it is worth reading the documentation.

-->

<module name="Checker">
<module name="Header">
<property name="fileExtensions" value="java"/>
<property name="headerFile" value="hadoop-hdds/dev-support/checkstyle/license.header"/>
</module>

<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value=".*/target/generated.*"/>
<property name="fileNamePattern" value=".*/target/generated.*"/>
</module>

<module name="SuppressWarningsFilter"/>
Expand All @@ -77,18 +79,16 @@
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
</module>
<module name="TreeWalker">

<module name="SuppressWarningsHolder"/>
<module name="SuppressionCommentFilter"/>
<module name="SuppressWithNearbyCommentFilter"/>


<!-- Checks for Javadoc comments. -->
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
<module name="JavadocType">
<property name="scope" value="public"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowUnknownTags" value="false"/>
<property name="scope" value="public"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowUnknownTags" value="false"/>
</module>
<module name="JavadocStyle"/>
<module name="MissingJavadocPackage"/>
Expand All @@ -106,45 +106,31 @@
<module name="StaticVariableName"/>
<module name="TypeName"/>


<!-- Checks for Headers -->
<!-- See http://checkstyle.sf.net/config_header.html -->
<!-- <module name="Header"> -->
<!-- The follow property value demonstrates the ability -->
<!-- to have access to ANT properties. In this case it uses -->
<!-- the ${basedir} property to allow Checkstyle to be run -->
<!-- from any directory within a project. See property -->
<!-- expansion, -->
<!-- http://checkstyle.sf.net/config.html#properties -->
<!-- <property -->
<!-- name="headerFile" -->
<!-- value="${basedir}/java.header"/> -->
<!-- </module> -->

<!-- Following interprets the header file as regular expressions. -->
<!-- <module name="RegexpHeader"/> -->


<!-- Checks for imports -->
<!-- Checks for imports -->
<!-- See http://checkstyle.sf.net/config_import.html -->
<module name="IllegalImport">
<property name="regexp" value="true"/>
<property name="illegalPkgs" value="^sun\..*, ^.*\.relocated\..*, ^.*\.shaded\..*"/>
<property name="illegalClasses" value="^org.apache.hadoop.test.(GenericTestUtils|LambdaTestUtils|TimedOutTestsListener)"/>
<property name="regexp" value="true"/>
<property name="illegalPkgs" value="^sun\..*, ^.*\.relocated\..*, ^.*\.shaded\..*"/>
<property name="illegalClasses"
value="^org.apache.hadoop.test.(GenericTestUtils|LambdaTestUtils|TimedOutTestsListener)"/>
</module>
<module name="RedundantImport"/>
<module name="UnusedImports"/>
<module name="AvoidStarImport"/>

<module name="AvoidStarImport"/>
<module name="CustomImportOrder">
<property name="sortImportsInGroupAlphabetically" value="true"/>
<property name="separateLineBetweenGroups" value="true"/>
<property name="customImportOrderRules" value="STATIC###THIRD_PARTY_PACKAGE"/>
<property name="tokens" value="IMPORT, STATIC_IMPORT, PACKAGE_DEF"/>
</module>

<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<module name="MethodLength"/>
<module name="ParameterNumber">
<property name="ignoreOverriddenMethods" value="true"/>
<property name="ignoreOverriddenMethods" value="true"/>
</module>


<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<module name="EmptyForIteratorPad"/>
Expand All @@ -154,18 +140,14 @@
<module name="ParenPad"/>
<module name="TypecastParenPad"/>
<module name="WhitespaceAfter">
<property name="tokens" value="COMMA, SEMI"/>
<property name="tokens" value="COMMA, SEMI"/>
</module>
<module name="WhitespaceAround"/>


<!-- Modifier Checks -->
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
<!-- This one is nitty, disable -->
<!-- <module name="ModifierOrder"/> -->
<module name="RedundantModifier"/>


<!-- Checks for blocks. You know, those {}'s -->
<!-- See http://checkstyle.sf.net/config_blocks.html -->
<module name="AvoidNestedBlocks"/>
Expand All @@ -174,16 +156,14 @@
<module name="NeedBraces"/>
<module name="RightCurly"/>


<!-- Checks for common coding problems -->
<!-- See http://checkstyle.sf.net/config_coding.html -->
<!-- module name="AvoidInlineConditionals"/-->
<module name="EmptyStatement"/>
<module name="EqualsHashCode"/>
<module name="HiddenField">
<property name="ignoreConstructorParameter" value="true"/>
<property name="ignoreSetter" value="true"/>
<property name="setterCanReturnItsClass" value="true"/>
<property name="ignoreConstructorParameter" value="true"/>
<property name="ignoreSetter" value="true"/>
<property name="setterCanReturnItsClass" value="true"/>
</module>
<module name="IllegalInstantiation"/>
<module name="InnerAssignment"/>
Expand All @@ -198,18 +178,16 @@
<module name="InterfaceIsType"/>
<module name="VisibilityModifier"/>


<!-- Miscellaneous other checks. -->
<!-- See http://checkstyle.sf.net/config_misc.html -->
<module name="ArrayTypeStyle"/>
<module name="Indentation">
<property name="basicOffset" value="2" />
<property name="caseIndent" value="0" />
<property name="basicOffset" value="2"/>
<property name="caseIndent" value="0"/>
</module>
<!--<module name="TodoComment"/>-->

<module name="UpperEll"/>

<module name="ModifierOrder"/>
</module>

</module>
17 changes: 17 additions & 0 deletions hadoop-hdds/dev-support/checkstyle/license.header
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* 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.
*/

28 changes: 28 additions & 0 deletions hadoop-hdds/dev-support/checkstyle/suppressions-skip-imports.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0"?>
<!--
Licensed 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. See accompanying LICENSE file.
-->
<!-- TODO: To be removed as soon as epic https://issues.apache.org/jira/browse/HDDS-12251 is done. -->
<!DOCTYPE suppressions PUBLIC
"-//Checkstyle//DTD SuppressionFilter Configuration 1.1//EN"
"https://checkstyle.org/dtds/suppressions_1_1.dtd">

<suppressions>
<suppress checks="JavadocPackage" files="[\\/]src[\\/]test[\\/].*"/>
<suppress checks="JavadocPackage" files="src/main/java/org/apache/hadoop/io/erasurecode/rawcoder"/>
<suppress checks="IllegalImport" files="src/test/java/org/apache/hadoop/fs/contract/.*java"/>
<suppress checks="MissingJavadocType" files="src/test/java/org/apache/hadoop/fs/contract/.*java"/>
<suppress checks="IllegalImport" files="src/test/java/org/apache/hadoop/tools/contract/.*java"/>
<suppress checks="CustomImportOrder" files=".*"/>
<suppress checks="Header" files=".*"/>
Comment on lines +26 to +27
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment in suppressions.xml mentioning that it is duplicated temporarily in this new file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's raise a ticket for removing this file and make it part of the epic.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will be a part of the last ticket of the epic. No need to create a separate ticket to remove file which will not be accessed by anything in the code

</suppressions>
7 changes: 7 additions & 0 deletions hadoop-hdds/erasurecode/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@
<proc>none</proc>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<suppressionsLocation>${basedir}/../../hadoop-hdds/dev-support/checkstyle/suppressions-skip-imports.xml</suppressionsLocation>
</configuration>
</plugin>
</plugins>
</build>
</project>
7 changes: 7 additions & 0 deletions hadoop-hdds/framework/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,13 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<suppressionsLocation>${basedir}/../../hadoop-hdds/dev-support/checkstyle/suppressions-skip-imports.xml</suppressionsLocation>
</configuration>
</plugin>
</plugins>
</build>
</project>
7 changes: 7 additions & 0 deletions hadoop-hdds/managed-rocksdb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@
<proc>none</proc>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<suppressionsLocation>${basedir}/../../hadoop-hdds/dev-support/checkstyle/suppressions-skip-imports.xml</suppressionsLocation>
</configuration>
</plugin>
</plugins>
</build>
</project>
7 changes: 7 additions & 0 deletions hadoop-hdds/rocks-native/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@
<proc>none</proc>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<suppressionsLocation>${basedir}/../../hadoop-hdds/dev-support/checkstyle/suppressions-skip-imports.xml</suppressionsLocation>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
Expand Down
7 changes: 7 additions & 0 deletions hadoop-hdds/rocksdb-checkpoint-differ/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@
<proc>none</proc>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<suppressionsLocation>${basedir}/../../hadoop-hdds/dev-support/checkstyle/suppressions-skip-imports.xml</suppressionsLocation>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
Expand Down
7 changes: 7 additions & 0 deletions hadoop-hdds/server-scm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,13 @@
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml</excludeFilterFile>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<suppressionsLocation>${basedir}/../../hadoop-hdds/dev-support/checkstyle/suppressions-skip-imports.xml</suppressionsLocation>
</configuration>
</plugin>
</plugins>
</build>
</project>
7 changes: 7 additions & 0 deletions hadoop-hdds/test-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@
<proc>none</proc>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<suppressionsLocation>${basedir}/../../hadoop-hdds/dev-support/checkstyle/suppressions-skip-imports.xml</suppressionsLocation>
</configuration>
</plugin>
</plugins>
</build>
</project>
Loading