You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2022/05/05 08:56:26 UTC

[servicecomb-java-chassis] branch master updated: [SCB-2476] Split checkstyle to a independent task to speed up ci (#2816)

This is an automated email from the ASF dual-hosted git repository.

liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-java-chassis.git


The following commit(s) were added to refs/heads/master by this push:
     new c28e9c5c2 [SCB-2476] Split checkstyle to a independent task to speed up ci (#2816)
c28e9c5c2 is described below

commit c28e9c5c25d83b18c028c76d6d30df71c5203a7d
Author: ZhangJian He <sh...@gmail.com>
AuthorDate: Thu May 5 16:56:21 2022 +0800

    [SCB-2476] Split checkstyle to a independent task to speed up ci (#2816)
---
 .github/workflows/{maven.yml => checkstyle.yml} | 36 +++++++-------------
 .github/workflows/maven.yml                     |  2 +-
 etc/checkstyle.xml                              |  9 +++--
 etc/findbugs-exclude.xml                        | 45 -------------------------
 pom.xml                                         | 14 +-------
 5 files changed, 18 insertions(+), 88 deletions(-)

diff --git a/.github/workflows/maven.yml b/.github/workflows/checkstyle.yml
similarity index 52%
copy from .github/workflows/maven.yml
copy to .github/workflows/checkstyle.yml
index 15946bb73..bca3fc6c7 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/checkstyle.yml
@@ -17,33 +17,21 @@
 # under the License.
 #
 
-name: Java CI with Maven
-
+name: checkstyle
 on:
-  push:
-    branches: [ master ]
   pull_request:
-    branches: [ master ]
+    branches:
+      - master
 
 jobs:
-  build:
-
+  publish:
     runs-on: ubuntu-latest
-
     steps:
-    - uses: actions/checkout@v2
-    - name: Set up jdk
-      uses: actions/setup-java@v2
-      with:
-        java-version: '8'
-        distribution: 'temurin'
-    - uses: actions/cache@v2
-      with:
-        path: ~/.m2/repository
-        key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
-        restore-keys: |
-          ${{ runner.os }}-maven-
-    - name: Compilation and Installation
-      run: mvn clean install -Dspotbugs.skip=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B -Pdocker -Pdemo-run-release -Pjacoco -Pit -Pcoverage
-    - name: publish coverage report
-      run: bash <(curl -s https://codecov.io/bash)
+      - uses: actions/checkout@v2
+      - name: Set up jdk
+        uses: actions/setup-java@v2
+        with:
+          java-version: '17'
+          distribution: 'temurin'
+      - name: checkstyle
+        run: mvn -B -Pit install -DskipTests -Dspotbugs.skip=true checkstyle:checkstyle
diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index 15946bb73..ccf7917fa 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/maven.yml
@@ -44,6 +44,6 @@ jobs:
         restore-keys: |
           ${{ runner.os }}-maven-
     - name: Compilation and Installation
-      run: mvn clean install -Dspotbugs.skip=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B -Pdocker -Pdemo-run-release -Pjacoco -Pit -Pcoverage
+      run: mvn clean install -Dcheckstyle.skip -Dspotbugs.skip=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B -Pdocker -Pdemo-run-release -Pjacoco -Pit -Pcoverage
     - name: publish coverage report
       run: bash <(curl -s https://codecov.io/bash)
diff --git a/etc/checkstyle.xml b/etc/checkstyle.xml
index 546932fe3..08d5b8e3a 100644
--- a/etc/checkstyle.xml
+++ b/etc/checkstyle.xml
@@ -29,7 +29,6 @@
   <property name="severity" value="warning"/>
   <property name="fileExtensions" value="java, properties, xml"/>
   <module name="TreeWalker">
-    <module name="FileContentsHolder"/>
     <module name="ConstantName"/>
     <module name="LocalFinalVariableName"/>
     <module name="LocalVariableName"/>
@@ -45,9 +44,6 @@
     <module name="UnusedImports">
       <property name="processJavadoc" value="false"/>
     </module>
-    <module name="LineLength">
-      <property name="max" value="120"/>
-    </module>
     <module name="MethodLength"/>
     <module name="ParameterNumber"/>
     <module name="EmptyForIteratorPad"/>
@@ -91,9 +87,12 @@
       <message key="todo.match" value="TODO: ''{0}'' 。"/>
       <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
     </module>
+    <module name="SuppressionCommentFilter"/>
     <module name="UpperEll"/>
   </module>
-  <module name="SuppressionCommentFilter"/>
+  <module name="LineLength">
+    <property name="max" value="120"/>
+  </module>
   <module name="NewlineAtEndOfFile"/>
   <module name="Translation"/>
   <module name="FileLength"/>
diff --git a/etc/findbugs-exclude.xml b/etc/findbugs-exclude.xml
deleted file mode 100644
index 8bacf38dc..000000000
--- a/etc/findbugs-exclude.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ 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.
-  -->
-
-<FindBugsFilter>
-    <Match>
-        <Class name="~.*Test$"/>
-    </Match>
-    <Match>
-        <Package name="~test\..*"/>
-    </Match>
-    <Match>
-        <Class name="~.*\.*Test.*"/>
-    </Match>
-    <!-- Match any test packages -->
-    <Match>
-        <Package name="~.*\.test"/>
-    </Match>
-    <Match>
-        <Package name="~.*\.demo"/>
-    </Match>
-    <Match>
-        <Class name="~.*\._.*"/>
-    </Match>
-    <Match>
-        <Class name="~.*\.*Test"/>
-    </Match>
-    <Match>
-        <Package name="~com\.huawei\.paas\.cse\.demo.*"/>
-    </Match>
-</FindBugsFilter>
diff --git a/pom.xml b/pom.xml
index a0722ebdd..e3e292926 100644
--- a/pom.xml
+++ b/pom.xml
@@ -45,12 +45,11 @@
     <test.additional.args/>
     <!-- plugin version start -->
     <!-- sort by alpha -->
-    <checkstyle-maven-plugin.version>2.17</checkstyle-maven-plugin.version>
+    <checkstyle-maven-plugin.version>3.1.2</checkstyle-maven-plugin.version>
     <coveralls-maven-plugin.version>4.3.0</coveralls-maven-plugin.version>
     <dependency-check-maven-plugin.version>7.0.4</dependency-check-maven-plugin.version>
     <docker-maven-plugin.version>0.33.0</docker-maven-plugin.version>
     <exec-maven-plugin.version>3.0.0</exec-maven-plugin.version>
-    <findbugs-maven-plugin.version>3.0.1</findbugs-maven-plugin.version>
     <gmaven-plugin.version>1.5</gmaven-plugin.version>
     <gpg-maven-plugin.version>1.6</gpg-maven-plugin.version>
     <lifecycle-mapping-plugin.version>1.0.0</lifecycle-mapping-plugin.version>
@@ -293,17 +292,6 @@
           <runOrder>alphabetical</runOrder>
         </configuration>
       </plugin>
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>findbugs-maven-plugin</artifactId>
-        <version>${findbugs-maven-plugin.version}</version>
-        <configuration>
-          <findbugsXmlOutput>true</findbugsXmlOutput>
-          <findbugsXmlWithMessages>true</findbugsXmlWithMessages>
-          <xmlOutput>true</xmlOutput>
-          <excludeFilterFile>findbugs-exclude.xml</excludeFilterFile>
-        </configuration>
-      </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-jar-plugin</artifactId>