You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rg...@apache.org on 2022/02/22 08:36:17 UTC

[logging-log4j2] branch release-2.x updated: Fix checkstyle rules broken due to upgrade of checkstyle version

This is an automated email from the ASF dual-hosted git repository.

rgoers pushed a commit to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git


The following commit(s) were added to refs/heads/release-2.x by this push:
     new 24ff45d  Fix checkstyle rules broken due to upgrade of checkstyle version
24ff45d is described below

commit 24ff45ded92612bd9d07326e4fe728743fc54ab7
Author: Ralph Goers <rg...@apache.org>
AuthorDate: Tue Feb 22 01:36:02 2022 -0700

    Fix checkstyle rules broken due to upgrade of checkstyle version
---
 checkstyle.xml | 36 ++++++++++++------------------------
 pom.xml        | 15 +++++++++++++++
 2 files changed, 27 insertions(+), 24 deletions(-)

diff --git a/checkstyle.xml b/checkstyle.xml
index 80ad14d..4ac1c24 100644
--- a/checkstyle.xml
+++ b/checkstyle.xml
@@ -24,6 +24,8 @@
 <module name="Checker">
     <property name="localeLanguage" value="en"/>
 
+    <property name="cacheFile" value="${checkstyle.cache.file}"/>
+
     <!-- Checks that a package.html file exists for each package.     -->
     <!-- See http://checkstyle.sourceforge.net/config_javadoc.html -->
     <module name="JavadocPackage"/>
@@ -62,33 +64,24 @@
       <property name="fileExtensions" value="java"/>
     </module>
 
-    <!-- Exceptions -->
-    <!--<module name="SuppressionFilter">
-        <property name="file" value="conf/checkstyle-suppressions.xml"/>
-    </module> -->
-    <!--
-    <module name="SuppressionCommentFilter">
-      <property name="offCommentFormat" value="Check\:OFF\: ([\w\|]+)"/>
-      <property name="onCommentFormat" value="Check\:ON\: ([\w\|]+)"/>
-      <property name="checkFormat" value="$1"/>
+    <module name="LineLength">
+        <property name="max" value="120"/>
+        <!-- Ignore import statements -->
+        <property name="ignorePattern" value="^import\s.*$"/>
     </module>
-    -->
-    <module name="SuppressionCommentFilter" />
-    <module name="SuppressWithNearbyCommentFilter"/>
 
     <module name="TreeWalker">
 
-        <property name="cacheFile" value="${checkstyle.cache.file}"/>
-
-        <!-- Ensure that CHECKSTYLE:OFF comments are available to the filter: -->
-        <module name="FileContentsHolder"/>
+        <module name="SuppressionCommentFilter" />
+        <module name="SuppressWithNearbyCommentFilter"/>
 
         <!-- Checks for Javadoc comments.                     -->
         <!-- See http://checkstyle.sf.net/config_javadoc.html -->
         <module name="JavadocMethod">
-            <property name="scope" value="public"/>
-            <property name="allowUndeclaredRTE" value="true"/>
-              <property name="allowMissingJavadoc" value="true"/>
+            <property name="accessModifiers" value="public"/>
+        </module>
+        <module name="MissingJavadocMethodCheck">
+            <property name="allowMissingPropertyJavadoc" value="true"/>
         </module>
         <module name="JavadocType">
             <!-- <property name="authorFormat" value="null"/> -->
@@ -154,11 +147,6 @@
         <!-- Checks for Size Violations.                    -->
         <!-- See http://checkstyle.sf.net/config_sizes.html -->
         <!--<module name="FileLength"/>-->
-        <module name="LineLength">
-            <property name="max" value="120"/>
-            <!-- Ignore import statements -->
-            <property name="ignorePattern" value="^import\s.*$"/>
-        </module>
         <module name="MethodLength"/>
         <module name="ParameterNumber">
             <property name="max" value="15"/>
diff --git a/pom.xml b/pom.xml
index b294e20..c04a3fa 100644
--- a/pom.xml
+++ b/pom.xml
@@ -253,6 +253,7 @@
     <surefire.plugin.version>3.0.0-M5</surefire.plugin.version>
     <failsafe.plugin.version>3.0.0-M5</failsafe.plugin.version>
     <checkstyle.plugin.version>3.1.2</checkstyle.plugin.version>
+    <checkstyle.tool.version>8.45.1</checkstyle.tool.version>
     <deploy.plugin.version>2.8.2</deploy.plugin.version>
     <rat.plugin.version>0.13</rat.plugin.version>
     <pdf.plugin.version>1.2</pdf.plugin.version>
@@ -1063,6 +1064,13 @@
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-checkstyle-plugin</artifactId>
           <version>${checkstyle.plugin.version}</version>
+          <dependencies>
+            <dependency>
+              <groupId>com.puppycrawl.tools</groupId>
+              <artifactId>checkstyle</artifactId>
+              <version>${checkstyle.tool.version}</version>
+            </dependency>
+          </dependencies>
         </plugin>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
@@ -1220,6 +1228,13 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-checkstyle-plugin</artifactId>
+        <dependencies>
+          <dependency>
+            <groupId>com.puppycrawl.tools</groupId>
+            <artifactId>checkstyle</artifactId>
+            <version>${checkstyle.tool.version}</version>
+          </dependency>
+        </dependencies>
       </plugin>
       <plugin>
         <artifactId>maven-clean-plugin</artifactId>