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

terrymanu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new f8cf088c84e Enhance Checkstyle rules for source consistency (#39658)
f8cf088c84e is described below

commit f8cf088c84e5fd5942f2287be58c4855e8ec4704
Author: Liang Zhang <[email protected]>
AuthorDate: Mon Aug 31 01:46:01 2026 +0800

    Enhance Checkstyle rules for source consistency (#39658)
    
    * Enhance Checkstyle rules for source consistency
    
    * Enhance Checkstyle rules for source consistency
---
 pom.xml                      | 19 +++++++++++--------
 src/resources/checkstyle.xml | 13 ++++++++++++-
 2 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/pom.xml b/pom.xml
index 73674dc6028..4ac7f9affde 100644
--- a/pom.xml
+++ b/pom.xml
@@ -924,6 +924,17 @@
                 </plugin>
                 
                 <!-- Report plugins -->
+                <plugin>
+                    <artifactId>maven-checkstyle-plugin</artifactId>
+                    <version>${maven-checkstyle-plugin.version}</version>
+                    <dependencies>
+                        <dependency>
+                            <groupId>com.puppycrawl.tools</groupId>
+                            <artifactId>checkstyle</artifactId>
+                            <version>${checkstyle.version}</version>
+                        </dependency>
+                    </dependencies>
+                </plugin>
                 <plugin>
                     <artifactId>maven-javadoc-plugin</artifactId>
                     <version>${maven-javadoc-plugin.version}</version>
@@ -1353,7 +1364,6 @@
                         </plugin>
                         <plugin>
                             <artifactId>maven-checkstyle-plugin</artifactId>
-                            
<version>${maven-checkstyle-plugin.version}</version>
                             <configuration>
                                 <consoleOutput>true</consoleOutput>
                                 <failOnViolation>true</failOnViolation>
@@ -1364,13 +1374,6 @@
                                 
<includeTestSourceDirectory>true</includeTestSourceDirectory>
                                 <excludes>**/autogen/**/*</excludes>
                             </configuration>
-                            <dependencies>
-                                <dependency>
-                                    <groupId>com.puppycrawl.tools</groupId>
-                                    <artifactId>checkstyle</artifactId>
-                                    <version>${checkstyle.version}</version>
-                                </dependency>
-                            </dependencies>
                         </plugin>
                         <plugin>
                             <artifactId>maven-pmd-plugin</artifactId>
diff --git a/src/resources/checkstyle.xml b/src/resources/checkstyle.xml
index 675c399d593..a2cafa0efeb 100644
--- a/src/resources/checkstyle.xml
+++ b/src/resources/checkstyle.xml
@@ -36,6 +36,9 @@
         <property name="fileExtensions" value="java" />
         <property name="max" value="200" />
     </module>
+    <module name="LineEnding">
+        <property name="lineEnding" value="lf" />
+    </module>
     <module name="NewlineAtEndOfFile">
         <property name="lineSeparator" value="lf" />
     </module>
@@ -61,6 +64,7 @@
         <module name="AnnotationUseStyle" />
         <module name="MissingDeprecated" />
         <module name="MissingOverride" />
+        <module name="MissingOverrideOnRecordAccessor" />
         <module name="PackageAnnotation" />
         <module name="SuppressWarnings">
             <property name="format" value="^(?i:all)$" />
@@ -75,6 +79,10 @@
         </module>
         <module name="LeftCurly" />
         <module name="RightCurly" />
+        <module name="RightCurly">
+            <property name="id" value="RightCurlySwitch" />
+            <property name="tokens" value="LITERAL_SWITCH, LITERAL_CASE, 
LITERAL_DEFAULT" />
+        </module>
         <module name="NeedBraces" />
         
         <!-- Class Design -->
@@ -147,7 +155,9 @@
         <module name="UnnecessarySemicolonAfterTypeMemberDeclaration" />
         <module name="UnnecessarySemicolonInEnumeration" />
         <module name="UnnecessarySemicolonInTryWithResources" />
-        <module name="UnusedLocalVariable" />
+        <module name="UnusedLocalVariable">
+            <property name="jdkVersion" value="21" />
+        </module>
         <module name="VariableDeclarationUsageDistance" />
         <module name="RegexpSinglelineJava">
             <property name="format" 
value="^(?!\s*import\s+java\.util\.Map\.Entry\s*;).*\b(?:java\.util\.)?Map\.Entry\b"
 />
@@ -239,6 +249,7 @@
             <property name="arrayInitIndent" value="2" />
             <property name="lineWrappingIndentation" value="8" />
         </module>
+        <module name="MultilineCommentLeadingAsteriskPresence" />
         <module name="NoCodeInFile" />
         <module name="OuterTypeFilename" />
         <module name="TodoComment" />

Reply via email to