Skip to content

Commit

Permalink
[chore](fe code style)add suppressions to fe check style (#9429)
Browse files Browse the repository at this point in the history
Current fe check style check all files. But some rules should be only applied on production files.
Add suppressions to suppress some rules on test files.
  • Loading branch information
morrySnow authored May 12, 2022
1 parent f11d320 commit 122cc3b
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
7 changes: 7 additions & 0 deletions fe/check/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ under the License.
<property name="fileNamePattern" value="module\-info\.java$"/>
</module>

<module name="SuppressionFilter">
<property name="file" value="fe/check/checkstyle/suppressions.xml"/>
<property name="optional" value="true"/>
</module>

<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
</module>
Expand Down Expand Up @@ -171,6 +176,7 @@ under the License.
</module>
<module name="InvalidJavadocPosition"/>
<module name="JavadocMethod">
<property name="id" value="ProductionScope"/>
<property name="accessModifiers" value="public"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
Expand All @@ -179,6 +185,7 @@ under the License.
</module>

<module name="JavadocParagraph"/>
<module name="JavadocStyle"/>
<module name="JavadocTagContinuationIndentation"/>
<module name="MissingJavadocMethod">
<property name="scope" value="public"/>
Expand Down
30 changes: 30 additions & 0 deletions fe/check/checkstyle/suppressions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

<!DOCTYPE suppressions PUBLIC
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
"https://checkstyle.org/dtds/suppressions_1_2.dtd">

<suppressions>
<!-- Excludes test files from having Javadocs for classes and methods -->
<suppress files="[\\/]jmockit[\\/]" checks=".*" />
<suppress files="[\\/]test[\\/]" checks="MissingJavadocMethod" />
<suppress files="[\\/]test[\\/]" checks="MissingJavadocType" />
</suppressions>
2 changes: 1 addition & 1 deletion fe/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ under the License.
</dependencies>
<configuration>
<configLocation>check/checkstyle/checkstyle.xml</configLocation>
<suppressionsLocation>check/checkstyle/suppressions.xml</suppressionsLocation>
<encoding>UTF-8</encoding>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
<linkXRef>false</linkXRef>
<excludes>**/jmockit/**/*</excludes>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
</configuration>
<executions>
Expand Down

0 comments on commit 122cc3b

Please sign in to comment.