You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "lamber-ken (Jira)" <ji...@apache.org> on 2019/11/21 09:47:00 UTC

[jira] [Comment Edited] (HUDI-354) Introduce stricter comment and code style validation rules

    [ https://issues.apache.org/jira/browse/HUDI-354?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16979133#comment-16979133 ] 

lamber-ken edited comment on HUDI-354 at 11/21/19 9:46 AM:
-----------------------------------------------------------

hi, I test in my local env just now, it did not affect the build process flow
{code:java}
mvn checkstyle:check
{code}
{code:java}
<module name="JavadocType">
    <property name="scope" value="protected"/>
    <property name="severity" value="info"/>
    <property name="allowMissingParamTags" value="true"/>
</module>
<module name="ImportOrder">
    <!-- Checks for out of order import statements. -->
    <property name="severity" value="info"/>
    <property name="groups" value="org.apache.hudi,*,javax,java,scala"/>
    <property name="separated" value="true"/>
    <property name="sortStaticImportsAlphabetically" value="true"/>
    <property name="option" value="bottom"/>
    <property name="tokens" value="STATIC_IMPORT, IMPORT"/>
    <message key="import.ordering"
             value="Import {0} appears after other imports that it should precede"/>
</module>
{code}


was (Author: lamber-ken):
hi, I test in my local env just now, it did affect the build process flow
{code:java}
mvn checkstyle:check
{code}
{code:java}
<module name="JavadocType">
    <property name="scope" value="protected"/>
    <property name="severity" value="info"/>
    <property name="allowMissingParamTags" value="true"/>
</module>
<module name="ImportOrder">
    <!-- Checks for out of order import statements. -->
    <property name="severity" value="info"/>
    <property name="groups" value="org.apache.hudi,*,javax,java,scala"/>
    <property name="separated" value="true"/>
    <property name="sortStaticImportsAlphabetically" value="true"/>
    <property name="option" value="bottom"/>
    <property name="tokens" value="STATIC_IMPORT, IMPORT"/>
    <message key="import.ordering"
             value="Import {0} appears after other imports that it should precede"/>
</module>
{code}

> Introduce stricter comment and code style validation rules
> ----------------------------------------------------------
>
>                 Key: HUDI-354
>                 URL: https://issues.apache.org/jira/browse/HUDI-354
>             Project: Apache Hudi (incubating)
>          Issue Type: Task
>            Reporter: vinoyang
>            Priority: Major
>
> This is an umbrella issue used to track apply some stricter comment and code style validation rules for the whole project. The rules list below:
>  # All public classes must add class-level comments;
>  # All comments must end with a clear "."
>  # In the import statement of the class, clearly distinguish (by blank lines) the import of Java SE and the import of non-java SE. Currently, I saw at least two projects(Spark and Flink) that implement this rule. Flink implements stricter rules than Spark. It is divided into several blocks from top to bottom(owner import -> non-owner and non-JavaSE import -> Java SE import -> static import), each block are sorted according to the natural sequence of letters;
>  # Reconfirm the method and whether the comment is consistency;
> Each project sub-module mappings to one subtask.
> How to find all the invalidated points?
>  * Add the XML code snippet into {{PROJECT_ROOT/style/checkstyle.xml}} : 
> {code:java}
> <module name="TreeWalker">
>     <!-- add the below modules-->
>     <!-- JAVADOC CHECKS -->
> <module name="JavadocStyle">
>     <property name="severity" value="info"/>
> </module>
> <module name="JavadocType">
>     <property name="scope" value="protected"/>
>     <property name="severity" value="info"/>
>     <property name="allowMissingParamTags" value="true"/>
> </module>
> <module name="ImportOrder">
>     <!-- Checks for out of order import statements. -->
>     <property name="severity" value="info"/>
>     <property name="groups" value="org.apache.hudi,*,javax,java,scala"/>
>     <property name="separated" value="true"/>
>     <property name="sortStaticImportsAlphabetically" value="true"/>
>     <property name="option" value="bottom"/>
>     <property name="tokens" value="STATIC_IMPORT, IMPORT"/>
>     <message key="import.ordering"
>       value="Import {0} appears after other imports that it should precede"/>
> </module>
> <module name="RedundantImport">
>     <!-- Checks for redundant import statements. -->
>     <property name="severity" value="info"/>
>     <message key="import.redundancy"
>       value="Redundant import {0}."/>
> </module>
> <module name="AvoidStarImport">
>     <property name="severity" value="info"/>
> </module>
> </module>{code}
>  *  Make sure you have installed CheckStyle-IDEA plugin and activated for the project.
>  * Scan the project module you want to refactor and fix all the issues one by one.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)