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

dongjoon pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/orc.git


The following commit(s) were added to refs/heads/main by this push:
     new 9b79de995 ORC-1665: Migrate to `importOrder` of `spotless-maven-plugin`
9b79de995 is described below

commit 9b79de995430b240cb68f225c22bef69ebbd8b07
Author: sychen <[email protected]>
AuthorDate: Tue Mar 26 10:02:00 2024 -0700

    ORC-1665: Migrate to `importOrder` of `spotless-maven-plugin`
    
    ### What changes were proposed in this pull request?
    This PR aims to enable the `importOrder` function in 
`spotless-maven-plugin`.
    
    ```bash
    mvn spotless:apply -Panalyze
    ```
    
    ### Why are the changes needed?
    Although there is now checkstyle to limit the order of imports, it cannot 
be automatically adjusted. `spotless-maven-plugin` can check and automatically 
adjust.
    
    https://github.com/apache/orc/pull/1859#pullrequestreview-1959266086
    
    ### How was this patch tested?
    local test
    
    ### Was this patch authored or co-authored using generative AI tooling?
    No
    
    Closes #1860 from cxzl25/ORC-1665.
    
    Authored-by: sychen <[email protected]>
    Signed-off-by: Dongjoon Hyun <[email protected]>
---
 java/checkstyle.xml | 9 ---------
 java/pom.xml        | 9 +++++++++
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/java/checkstyle.xml b/java/checkstyle.xml
index f35ae4b7c..4299bd59f 100644
--- a/java/checkstyle.xml
+++ b/java/checkstyle.xml
@@ -38,15 +38,6 @@
       <property name="allowClassImports" value="false"/>
       <property name="allowStaticMemberImports" value="false"/>
     </module>
-    <module name="RedundantImport"/>
-    <!-- https://checkstyle.sourceforge.io/config_imports.html#ImportOrder 
IntelliJ default example -->
-    <module name="CustomImportOrder">
-      <property name="customImportOrderRules" 
value="THIRD_PARTY_PACKAGE###SPECIAL_IMPORTS###STANDARD_JAVA_PACKAGE###STATIC"/>
-      <property name="specialImportsRegExp" value="^javax\."/>
-      <property name="standardPackageRegExp" value="^java\."/>
-      <property name="sortImportsInGroupAlphabetically" value="true"/>
-      <property name="separateLineBetweenGroups" value="false"/>
-    </module>
     <module name="ModifierOrder"/>
     <module name="RedundantModifier"/>
     <module name="NoLineWrap"/>
diff --git a/java/pom.xml b/java/pom.xml
index 77279c08d..c2d8712f8 100644
--- a/java/pom.xml
+++ b/java/pom.xml
@@ -350,6 +350,15 @@
               </sortPom>
             </pom>
             <java>
+              <includes>
+                <include>src/java/**/*.java</include>
+              </includes>
+              <excludes>
+                <exclude>src/test/**/*.java</exclude>
+              </excludes>
+              <importOrder>
+                <order>,javax|java,\#</order>
+              </importOrder>
               <removeUnusedImports></removeUnusedImports>
             </java>
           </configuration>

Reply via email to