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 d4f4ea739 ORC-1308: Add `AvoidStarImport` checkstyle rule
d4f4ea739 is described below

commit d4f4ea739bd4f1b9b638cf0d5c4d8bff092c0a97
Author: deshanxiao <[email protected]>
AuthorDate: Mon Nov 7 11:53:00 2022 -0800

    ORC-1308: Add `AvoidStarImport` checkstyle rule
    
    ### What changes were proposed in this pull request?
    This PR is aimed to avoid importing all classes from a package or static 
members from a class leads.
    
    ### Why are the changes needed?
    For codestyle:
    
    After the PR, stat import will be forbidden as following:
    - class imports like import java.util.*;
    - static member imports like import static org.junit.Assert.*;.
    
    https://checkstyle.sourceforge.io/config_imports.html#AvoidStarImport
    
    ### How was this patch tested?
    UT
    
    Closes #1309 from deshanxiao/deshan/1308.
    
    Authored-by: deshanxiao <[email protected]>
    Signed-off-by: Dongjoon Hyun <[email protected]>
---
 java/checkstyle.xml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/java/checkstyle.xml b/java/checkstyle.xml
index d55293f8a..a5b26dfa0 100644
--- a/java/checkstyle.xml
+++ b/java/checkstyle.xml
@@ -31,6 +31,10 @@
   <module name="TreeWalker">
     <module name="OuterTypeFilename"/>
     <module name="CommentsIndentation"/>
+    <module name="AvoidStarImport">
+      <property name="allowClassImports" value="false"/>
+      <property name="allowStaticMemberImports" value="false"/>
+    </module>
     <module name="UnusedImports"/>
     <module name="RedundantImport"/>
     <!-- https://checkstyle.sourceforge.io/config_imports.html#ImportOrder 
IntelliJ default example -->

Reply via email to