You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2022/05/09 15:17:11 UTC

[shardingsphere] branch master updated: The action process disables spotless code formatting (#17497)

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

zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 738634215b9 The action process disables spotless code formatting (#17497)
738634215b9 is described below

commit 738634215b99dcfd95091b275921aa2419af892a
Author: 龙台 Long Tai <77...@users.noreply.github.com>
AuthorDate: Mon May 9 23:17:04 2022 +0800

    The action process disables spotless code formatting (#17497)
    
    * Delete spotless profile and add plugin
    
    * Change spotless document description
    
    * GitHub workflows skip spotless code formatting
    
    * YML format indent
---
 .github/workflows/ci.yml                           | 12 +--
 .github/workflows/docker-per-commit.yaml           |  2 +-
 .github/workflows/it-scaling.yml                   | 10 +--
 .github/workflows/it.yml                           | 20 ++---
 .../content/contribute/code-conduct.cn.md          |  2 +-
 .../content/contribute/code-conduct.en.md          |  2 +-
 pom.xml                                            | 99 ++++++++++------------
 7 files changed, 70 insertions(+), 77 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 531b360f5ad..789fabd3dd7 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -83,7 +83,7 @@ jobs:
       - name: Build with Maven
         shell: cmd
         run: |
-          .\mvnw -B clean -D"maven.javadoc.skip"=true -D"rat.skip"=true install < nul
+          .\mvnw -B clean -D"maven.javadoc.skip"=true -D"rat.skip"=true -D"spotless.apply.skip"=true install < nul
           echo "mvnw exited"
       - name: Build examples with Maven
         run: ./mvnw -B -f examples/pom.xml clean package -DskipTests
@@ -99,15 +99,15 @@ jobs:
         java:
           - {
             version: 8,
-            maven_args: "-Dmaven.javadoc.skip=true -Drat.skip=true -Dcheckstyle.skip=true"
+            maven_args: "-Dmaven.javadoc.skip=true -Drat.skip=true -Dcheckstyle.skip=true -Dspotless.apply.skip=true"
           }
           - {
             version: 11,
-            maven_args: "-Dmaven.javadoc.skip=true -Drat.skip=true -Djacoco.skip=true"
+            maven_args: "-Dmaven.javadoc.skip=true -Drat.skip=true -Djacoco.skip=true -Dspotless.apply.skip=true"
           }
           - {
             version: 17,
-            maven_args: "-Dmaven.javadoc.skip=true -Drat.skip=true -Djacoco.skip=true"
+            maven_args: "-Dmaven.javadoc.skip=true -Drat.skip=true -Djacoco.skip=true -Dspotless.apply.skip=true"
           }
     steps:
       - uses: actions/checkout@v2
@@ -141,7 +141,7 @@ jobs:
         java:
           - {
             version: 8,
-            maven_args: "-Dmaven.javadoc.skip=true -Drat.skip=true -Dcheckstyle.skip=true"
+            maven_args: "-Dmaven.javadoc.skip=true -Drat.skip=true -Dcheckstyle.skip=true -Dspotless.apply.skip=true"
           }
     steps:
       - name: Cache Maven Repos
@@ -183,6 +183,6 @@ jobs:
           distribution: 'temurin'
           java-version: 8
       - name: Build Project
-        run: ./mvnw -B clean install -Dmaven.javadoc.skip=true -Drat.skip=true -Dcheckstyle.skip=true -DskipITs -DskipTests
+        run: ./mvnw -B clean install -Dmaven.javadoc.skip=true -Drat.skip=true -Dcheckstyle.skip=true -DskipITs -DskipTests -Dspotless.apply.skip=true
       - name: Run Example generator
         run: echo y | ./mvnw -B test -f examples/shardingsphere-example-generator/pom.xml -Pexample-generator
diff --git a/.github/workflows/docker-per-commit.yaml b/.github/workflows/docker-per-commit.yaml
index deefe66daae..0d831f34a3b 100644
--- a/.github/workflows/docker-per-commit.yaml
+++ b/.github/workflows/docker-per-commit.yaml
@@ -66,4 +66,4 @@ jobs:
       - name: Set up Docker Buildx
         uses: docker/setup-buildx-action@v1
       - name: Push docker image
-        run: ./mvnw -am -pl shardingsphere-distribution/shardingsphere-proxy-distribution -B -Prelease,docker.buildx.push -DskipTests -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Drat.skip=true -Dproxy.image.repository=${{ env.PROXY }} -Dproxy.image.tag=${{ github.sha }} clean install
+        run: ./mvnw -am -pl shardingsphere-distribution/shardingsphere-proxy-distribution -B -Prelease,docker.buildx.push -DskipTests -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Drat.skip=true -Dproxy.image.repository=${{ env.PROXY }} -Dproxy.image.tag=${{ github.sha }} clean install
diff --git a/.github/workflows/it-scaling.yml b/.github/workflows/it-scaling.yml
index 6bd9a5e9170..a0586619762 100644
--- a/.github/workflows/it-scaling.yml
+++ b/.github/workflows/it-scaling.yml
@@ -58,7 +58,7 @@ concurrency:
   cancel-in-progress: true
 
 env:
-  MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.javadoc.skip=true -Drat.skip=true -Dcheckstyle.skip=true -Djacoco.skip=true
+  MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.javadoc.skip=true -Drat.skip=true -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Djacoco.skip=true
 
 jobs:
   scaling-build-it-image:
@@ -82,7 +82,7 @@ jobs:
           distribution: 'temurin'
           java-version: 8
       - name: Build IT image
-        run: ./mvnw -B clean install -am -pl shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling -Pit.env.docker -DskipTests
+        run: ./mvnw -B clean install -am -pl shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling -Pit.env.docker -DskipTests -Dspotless.apply.skip=true
       - name: Save IT image
         run: docker save -o /tmp/shardingsphere-proxy-test.tar apache/shardingsphere-proxy-test:latest
       - name: Upload IT image
@@ -119,7 +119,7 @@ jobs:
       - name: Load IT image
         run: docker load -i /tmp/shardingsphere-proxy-test.tar
       - name: Run Integration Test
-        run: ./mvnw -nsu -B install -f shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/pom.xml -Dcheckstyle.skip=true -Dit.cluster.env.type=DOCKER -Dit.env.mysql.version=${{ env.mysql_version }} -Dit.env.postgresql.version=
+        run: ./mvnw -nsu -B install -f shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/pom.xml -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Dit.cluster.env.type=DOCKER -Dit.env.mysql.version=${{ env.mysql_version }} -Dit.env.postgresql.version=
   
   scaling-postgresql-it-test:
     if: (github.event_name != 'schedule' && github.repository == 'apache/shardingsphere')
@@ -149,7 +149,7 @@ jobs:
       - name: Load IT image
         run: docker load -i /tmp/shardingsphere-proxy-test.tar
       - name: Run Integration Test
-        run: ./mvnw -nsu -B install -f shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/pom.xml -Dcheckstyle.skip=true -Dit.cluster.env.type=DOCKER -Dit.env.postgresql.version=${{ env.postgresql_version }} -Dit.env.mysql.version=
+        run: ./mvnw -nsu -B install -f shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/pom.xml -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Dit.cluster.env.type=DOCKER -Dit.env.postgresql.version=${{ env.postgresql_version }} -Dit.env.mysql.version=
   
   scaling-daily-it-test:
     if: (github.event_name == 'schedule' && github.repository == 'apache/shardingsphere')
@@ -180,4 +180,4 @@ jobs:
       - name: Load IT image
         run: docker load -i /tmp/shardingsphere-proxy-test.tar
       - name: Run Integration Test
-        run: ./mvnw -nsu -B install -f shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/pom.xml -Dcheckstyle.skip=true -Dit.cluster.env.type=DOCKER -Dit.env.postgresql.version=${{ env.postgresql_version }} -Dit.env.mysql.version=${{ env.mysql_version }}
+        run: ./mvnw -nsu -B install -f shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/pom.xml -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Dit.cluster.env.type=DOCKER -Dit.env.postgresql.version=${{ env.postgresql_version }} -Dit.env.mysql.version=${{ env.mysql_version }}
diff --git a/.github/workflows/it.yml b/.github/workflows/it.yml
index ca2bb5db0c8..04a85e4e3dd 100644
--- a/.github/workflows/it.yml
+++ b/.github/workflows/it.yml
@@ -56,7 +56,7 @@ concurrency:
   cancel-in-progress: true
 
 env:
-  MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.javadoc.skip=true -Drat.skip=true -Djacoco.skip=true
+  MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.javadoc.skip=true -Drat.skip=true -Djacoco.skip=true -Dspotless.apply.skip=true
 
 jobs:
   build-it-image:
@@ -80,12 +80,12 @@ jobs:
           distribution: 'temurin'
           java-version: 8
       - name: Build IT image
-        run: ./mvnw -B clean install -am -pl shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite -Pit.env.docker -DskipTests
+        run: ./mvnw -B clean install -am -pl shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite -Pit.env.docker -DskipTests -Dspotless.apply.skip=true
       - name: Save IT image
         run: docker save -o /tmp/shardingsphere-proxy-test.tar apache/shardingsphere-proxy-test:latest
       - name: Upload IT image
         uses: actions/upload-artifact@v3
-        with: 
+        with:
           name: it-image
           path: /tmp/shardingsphere-proxy-test.tar
   
@@ -122,7 +122,7 @@ jobs:
         if: matrix.adapter == 'proxy'
         run: docker load -i /tmp/shardingsphere-proxy-test.tar
       - name: Run Integration Test
-        run: ./mvnw -nsu -B install -f shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/pom.xml -Dcheckstyle.skip=true -Dit.run.modes=Cluster -Dit.scenarios=${{ matrix.scenario }} -Dit.cluster.adapters=${{ matrix.adapter }} -Dit.cluster.databases=${{ matrix.database }} -Dit.cluster.env.type=DOCKER
+        run: ./mvnw -nsu -B install -f shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/pom.xml -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Dit.run.modes=Cluster -Dit.scenarios=${{ matrix.scenario }} -Dit.cluster.adapters=${{ matrix.adapter }} -Dit.cluster.databases=${{ matrix.database }} -Dit.cluster.env.type=DOCKER
   
   it-single-rule:
     name: single rule
@@ -157,7 +157,7 @@ jobs:
         if: matrix.adapter == 'proxy'
         run: docker load -i /tmp/shardingsphere-proxy-test.tar
       - name: Run Integration Test
-        run: ./mvnw -nsu -B install -f shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/pom.xml -Dcheckstyle.skip=true -Dit.run.modes=Cluster -Dit.scenarios=${{ matrix.scenario }} -Dit.cluster.adapters=${{ matrix.adapter }} -Dit.culster.databases=${{ matrix.database }} -Dit.cluster.env.type=DOCKER
+        run: ./mvnw -nsu -B install -f shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/pom.xml -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Dit.run.modes=Cluster -Dit.scenarios=${{ matrix.scenario }} -Dit.cluster.adapters=${{ matrix.adapter }} -Dit.culster.databases=${{ matrix.database }} -Dit.cluster.env.type=DOCKER
   
   it-mixture-rule:
     name: mixture rule
@@ -192,7 +192,7 @@ jobs:
         if: matrix.adapter == 'proxy'
         run: docker load -i /tmp/shardingsphere-proxy-test.tar
       - name: Run Integration Test
-        run: ./mvnw -nsu -B install -f shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/pom.xml -Dcheckstyle.skip=true -Dit.run.modes=Cluster -Dit.scenarios=${{ matrix.scenario }} -Dit.cluster.adapters=${{ matrix.adapter }} -Dit.cluster.databases=${{ matrix.database }} -Dit.cluster.env.type=DOCKER
+        run: ./mvnw -nsu -B install -f shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/pom.xml -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Dit.run.modes=Cluster -Dit.scenarios=${{ matrix.scenario }} -Dit.cluster.adapters=${{ matrix.adapter }} -Dit.cluster.databases=${{ matrix.database }} -Dit.cluster.env.type=DOCKER
   
   mysql-proxy-agent:
     name: Agent Metrics & OpenTelemetry
@@ -217,9 +217,9 @@ jobs:
         run: ./mvnw -B clean install -Dcheckstyle.skip=true -DskipITs -DskipTests
       - name: Verify
         run: |
-          ./mvnw -B clean verify -pl shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-metrics -DskipITs -DskipTests
-          ./mvnw -B clean verify -pl shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-opentelemetry -DskipITs -DskipTests
+          ./mvnw -B clean verify -pl shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-metrics -DskipITs -DskipTests -Dspotless.apply.skip=true
+          ./mvnw -B clean verify -pl shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-opentelemetry -DskipITs -DskipTests -Dspotless.apply.skip=true
       - name: Run Integration Test
         run: |
-          ./mvnw -B clean install -f shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-metrics/pom.xml -Dcheckstyle.skip=true -Pit.env.metrics
-          ./mvnw -B clean install -f shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-opentelemetry/pom.xml -Dcheckstyle.skip=true -Pit.env.opentelemetry
+          ./mvnw -B clean install -f shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-metrics/pom.xml -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Pit.env.metrics
+          ./mvnw -B clean install -f shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-opentelemetry/pom.xml -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Pit.env.opentelemetry
diff --git a/docs/community/content/contribute/code-conduct.cn.md b/docs/community/content/contribute/code-conduct.cn.md
index d2c917ffaae..e989b63de94 100644
--- a/docs/community/content/contribute/code-conduct.cn.md
+++ b/docs/community/content/contribute/code-conduct.cn.md
@@ -23,7 +23,7 @@ chapter = true
  - 应尽量将设计精细化拆分;做到小幅度修改,多次数提交,但应保证提交的完整性。
  - 确保遵守编码规范。
  - 如果您使用 IDEA,可导入推荐的 [Settings](https://shardingsphere.apache.org/community/data/shardingsphere-settings.jar)。
- - 通过 Spotless 统一代码风格,执行 Maven 命令时添加 `-Pcode.format`。
+ - 通过 Spotless 统一代码风格,执行 `mvn spotless:apply` 格式化代码。
  
 ## 编码规范
 
diff --git a/docs/community/content/contribute/code-conduct.en.md b/docs/community/content/contribute/code-conduct.en.md
index a52b12f4915..cef80190d88 100644
--- a/docs/community/content/contribute/code-conduct.en.md
+++ b/docs/community/content/contribute/code-conduct.en.md
@@ -20,7 +20,7 @@ The following code of conduct is based on full compliance with [ASF CODE OF COND
  - Careful consideration for each `pull request`; Small and frequent `pull request` with complete unit function is welcomed.
  - Conform to `Contributor Covenant Code of Conduct` below.
  - If using IDEA, you can import the recommended [Settings](https://shardingsphere.apache.org/community/data/shardingsphere-settings.jar).
- - Through the uniform code style of spotless, add `-Pcode.format` when executing Maven command.
+ - Through the uniform code style of spotless, execute the `mvn spotless:apply` formatted code.
 
 ## Contributor Covenant Code of Conduct
 
diff --git a/pom.xml b/pom.xml
index c59cf129c24..9f8d5870a33 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1030,6 +1030,52 @@
                     </execution>
                 </executions>
             </plugin>
+            <plugin>
+                <groupId>com.diffplug.spotless</groupId>
+                <artifactId>spotless-maven-plugin</artifactId>
+                <version>${spotless-maven-plugin.version}</version>
+                <configuration>
+                    <java>
+                        <eclipse>
+                            <file>${maven.multiModuleProjectDirectory}/src/resources/spotless_shardingsphere_formatter.xml</file>
+                        </eclipse>
+                        <licenseHeader>
+                            <file>${maven.multiModuleProjectDirectory}/src/resources/license-header</file>
+                        </licenseHeader>
+                    </java>
+                    <pom>
+                        <sortPom>
+                            <encoding>UTF-8</encoding>
+                            <nrOfIndentSpace>4</nrOfIndentSpace>
+                            <keepBlankLines>true</keepBlankLines>
+                            <indentBlankLines>true</indentBlankLines>
+                            <indentSchemaLocation>true</indentSchemaLocation>
+                            <spaceBeforeCloseEmptyElement>true</spaceBeforeCloseEmptyElement>
+                            <sortModules>false</sortModules>
+                            <sortExecutions>false</sortExecutions>
+                            <predefinedSortOrder>custom_1</predefinedSortOrder>
+                            <expandEmptyElements>false</expandEmptyElements>
+                            <sortProperties>false</sortProperties>
+                        </sortPom>
+                        <replace>
+                            <name>Leading blank line</name>
+                            <search>--&gt;
+&lt;project</search>
+                            <replacement>--&gt;
+
+&lt;project</replacement>
+                        </replace>
+                    </pom>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>apply</goal>
+                        </goals>
+                        <phase>compile</phase>
+                    </execution>
+                </executions>
+            </plugin>
             <plugin>
                 <artifactId>maven-checkstyle-plugin</artifactId>
                 <version>${maven-checkstyle-plugin.version}</version>
@@ -1299,58 +1345,5 @@
                 </pluginManagement>
             </build>
         </profile>
-        <profile>
-            <id>code.format</id>
-            <build>
-                <plugins>
-                    <plugin>
-                        <groupId>com.diffplug.spotless</groupId>
-                        <artifactId>spotless-maven-plugin</artifactId>
-                        <version>${spotless-maven-plugin.version}</version>
-                        <configuration>
-                            <java>
-                                <eclipse>
-                                    <file>${maven.multiModuleProjectDirectory}/src/resources/spotless_shardingsphere_formatter.xml</file>
-                                </eclipse>
-                                <licenseHeader>
-                                    <file>${maven.multiModuleProjectDirectory}/src/resources/license-header</file>
-                                </licenseHeader>
-                            </java>
-                            <pom>
-                                <sortPom>
-                                    <encoding>UTF-8</encoding>
-                                    <nrOfIndentSpace>4</nrOfIndentSpace>
-                                    <keepBlankLines>true</keepBlankLines>
-                                    <indentBlankLines>true</indentBlankLines>
-                                    <indentSchemaLocation>true</indentSchemaLocation>
-                                    <spaceBeforeCloseEmptyElement>true</spaceBeforeCloseEmptyElement>
-                                    <sortModules>false</sortModules>
-                                    <sortExecutions>false</sortExecutions>
-                                    <predefinedSortOrder>custom_1</predefinedSortOrder>
-                                    <expandEmptyElements>false</expandEmptyElements>
-                                    <sortProperties>false</sortProperties>
-                                </sortPom>
-                                <replace>
-                                    <name>Leading blank line</name>
-                                    <search>--&gt;
-&lt;project</search>
-                                    <replacement>--&gt;
-
-&lt;project</replacement>
-                                </replace>
-                            </pom>
-                        </configuration>
-                        <executions>
-                            <execution>
-                                <goals>
-                                    <goal>apply</goal>
-                                </goals>
-                                <phase>compile</phase>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
     </profiles>
 </project>