You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kylin.apache.org by GitBox <gi...@apache.org> on 2018/09/30 00:22:04 UTC

[GitHub] shaofengshi closed pull request #277: KYLIN-3602 Enable more checkstyle rules

shaofengshi closed pull request #277: KYLIN-3602 Enable more checkstyle rules
URL: https://github.com/apache/kylin/pull/277
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/dev-support/checkstyle-suppressions.xml b/dev-support/checkstyle-suppressions.xml
index 06de62554f..f110b7c3ef 100644
--- a/dev-support/checkstyle-suppressions.xml
+++ b/dev-support/checkstyle-suppressions.xml
@@ -25,4 +25,40 @@
     <suppress checks="." files=".*[/\\]generated[/\\].*\.java"/>
     <suppress checks="." files=".*[/\\]org[/\\]apache[/\\]calcite[/\\].*\.java"/>
     <suppress checks="MagicNumberCheck" files=".*Test\.java"/>
+
+    <!--
+    /* Temporary Suppressions
+     * The following files should be removed the suppression list after their checkstyle errors are fixed.
+     */
+    -->
+    <suppress checks="." files=".*[/\\]metadata[/\\].*\.java"/>
+
+    <suppress checks="LocalVariableName" files=".*Test\.java"/>
+    <suppress checks="LocalVariableName"
+              files="(KylinConfig|BytesUtil|SSHClient|CuboidRecommender|AggregationGroup|FunctionRule|CubingUtils|CalculateStatsFromBaseCuboidJob|KafkaInputFormati|DeployUtil|BuildCubeWithEngine|KafkaInputFormat).java"/>
+    <suppress checks="LocalVariableName"
+              files="(ExtractDictionaryFromGlobalJob|FactDistinctColumnsJob|UHCDictionaryJob|SparkExecutable|UnitTestSupport|AccessService|QueryService|AclEvaluate|MrJobInfoExtractor|CubeDescCreator).java"/>
+
+    <suppress checks="LocalFinalVariableName"
+              files="(StorageCleanupJob|DeployUtil).java"/>
+
+    <suppress checks="IllegalImport"
+              files="Bytes.java"/>
+
+    <suppress checks="MemberName" files=".*Test\.java"/>
+    <suppress checks="MemberName"
+              files="(TrieDictionaryBuilder|SparkFactDistinct|GTScannerBenchmark|TableMetaStub|JobInstance|DimCountDistinctCounter|ColumnMeta|ColumnMetaWithType|TableMeta|BlockingReservoir|RecordEventTimeDetail|HiveProducer|HBaseScannerBenchmark|AppendDictNode|GTScannerBenchmark2).java"/>
+
+    <suppress checks="TypeName"
+              files="ColumnMetaWithType.java"/>
+
+    <suppress checks="BooleanExpressionComplexity"
+              files="(Bytes|Number2BytesConverter|CubeService).java"/>
+
+    <suppress checks="ParameterNumber"
+              files="(QueryContext|GTScanRequest|HiveTableMeta|KylinMeta).java"/>
+
+    <suppress checks="OneStatementPerLine"
+              files="UHCDictionaryReducer.java"/>
+
 </suppressions>
diff --git a/dev-support/checkstyle.xml b/dev-support/checkstyle.xml
index 45325bf950..d8eb73fc89 100644
--- a/dev-support/checkstyle.xml
+++ b/dev-support/checkstyle.xml
@@ -28,11 +28,31 @@
     <module name="FileTabCharacter"/>
     <module name="SuppressWarningsFilter"/>
     <module name="TreeWalker">
+
+        <!-- Checks for Naming Conventions.                  -->
+        <!-- See http://checkstyle.sf.net/config_naming.html -->
+        <!-- <module name="ConstantName"/> -->
+        <module name="LocalVariableName"/>
+        <module name="LocalFinalVariableName">
+            <property name="format" value="^[a-zA-Z0-9]*$$"/>
+        </module>
+        <module name="MemberName"/>
+        <!-- <module name="MethodName"/> -->
+        <!-- <module name="ParameterName"/> -->
+        <!-- <module name="StaticVariableName"/> -->
+        <module name="TypeName"/>
+
         <module name="AvoidStarImport"/>
+        <module name="IllegalImport"/>
         <module name="RedundantImport"/>
         <module name="UnusedImports">
             <property name="processJavadoc" value="true"/>
         </module>
+        <!-- <module name="SimplifyBooleanExpression"/> -->
+        <module name="OneStatementPerLine"/>
+        <!-- <module name="SimplifyBooleanReturn"/> -->
+
+        <!-- code quality -->
         <module name="LineLength">
             <property name="max" value="1000"/>
             <property name="ignorePattern"
@@ -40,6 +60,15 @@
         </module>
         <module name="MethodLength"/>
         <module name="MethodParamPad"/>
+        <module name="ParameterNumber">
+            <!-- default is 8 -->
+            <property name="max" value="12"/>
+        </module>
+        <module name="BooleanExpressionComplexity">
+            <!-- default is 3 -->
+            <property name="max" value="5"/>
+        </module>
+
         <module name="ParenPad"/>
         <module name="EmptyStatement"/>
         <module name="EmptyBlock">


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services