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

hongbin ma commented on KYLIN-1821:
-----------------------------------


 
The code reformat is done for all of the JAVA files.
 
In order to make sure everyone is committing well formatted codes,
I have also enabled the checkstyle maven plugin, whose check rules are highly 
configurable.
To make our life easy I only chose basic rules regarding code format. (check 
Kylin/checkstyle.xml and Kylin/checkstyle-suppressions.xml)
That is to say, you’ll rarely violate the checkstyle rules as long as you 
remember to format code before committing.
 
However, violation of the rules will cause build fail.
Since the chosen rule set is really small, you should almost never think about 
removing rules to make your code compile.
There’re cases where you really can’t get over some certain rules, for example, 
In CubeHBaseEndpointRPC we have a very long method (don’t have time to reduce 
its size now):
The compile will fail due to: CubeHBaseEndpointRPC.java:263:5: Method length is 
157 lines (max allowed is 150).
Searching google with “site:checkstyle.sourceforge.net Method length is lines 
(max allowed is). ” we’ll find it violates the “MethodLength” rule.
We can add @SuppressWarnings("checkstyle:methodlength") (use lower case!) to 
the method to instruct checkstyle to overlook this occurrence.
 
The only action you need to do now is to follow 
http://kylin.apache.org/development/dev_env.html (Setup IDE code formatter) to 
setup formatter.
Perhaps enabling auto code format is a good option.
 

> Reformat all of the java files and enable checkstyle to enforce code 
> formatting
> -------------------------------------------------------------------------------
>
>                 Key: KYLIN-1821
>                 URL: https://issues.apache.org/jira/browse/KYLIN-1821
>             Project: Kylin
>          Issue Type: Improvement
>            Reporter: hongbin ma
>            Assignee: hongbin ma
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to