You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stormcrawler.apache.org by jn...@apache.org on 2024/05/07 08:55:56 UTC

(incubator-stormcrawler) branch main updated: Introduce "skip.format.code" to skip code formatting by default (#1213)

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

jnioche pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-stormcrawler.git


The following commit(s) were added to refs/heads/main by this push:
     new e944db17 Introduce "skip.format.code" to skip code formatting by default (#1213)
e944db17 is described below

commit e944db176e609151984db382dff4901c1af58b5e
Author: Richard Zowalla <13...@users.noreply.github.com>
AuthorDate: Tue May 7 10:55:52 2024 +0200

    Introduce "skip.format.code" to skip code formatting by default (#1213)
---
 .github/workflows/maven.yml | 2 +-
 README.md                   | 6 ++++++
 pom.xml                     | 3 +++
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index 7d683520..486c321f 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/maven.yml
@@ -19,7 +19,7 @@ jobs:
           distribution: adopt
           java-version: 17
       - name: Build with Maven
-        run: mvn -B --no-transfer-progress -Prat -DskipTests verify
+        run: mvn -B --no-transfer-progress -Prat -DskipTests verify -Dskip.format.code=false
 
   build:
     needs: rat
diff --git a/README.md b/README.md
index 62722570..d8e515ea 100644
--- a/README.md
+++ b/README.md
@@ -58,6 +58,12 @@ If you are running commands in a zsh shell, you may need to execute:
 mvn git-code-format:format-code -Dgcf.globPattern="**/*"
 ```
 
+You can enable pre-commit format hooks by running:
+
+```
+mvn clean install -Dskip.format.code=false
+```
+
 ## Thanks
 
 ![alt tag](https://www.yourkit.com/images/yklogo.png)
diff --git a/pom.xml b/pom.xml
index aa76643d..8dc14cef 100644
--- a/pom.xml
+++ b/pom.xml
@@ -73,6 +73,8 @@ under the License.
 		<testcontainers.version>1.19.7</testcontainers.version>
 		<maven.mojo.license.plugin>2.4.0</maven.mojo.license.plugin>
 		<jacoco.maven.plugin>0.8.11</jacoco.maven.plugin>
+
+		<skip.format.code>true</skip.format.code>
 	</properties>
 
 	<build>
@@ -292,6 +294,7 @@ under the License.
 					</dependency>
 				</dependencies>
 				<configuration>
+					<skip>${skip.format.code}</skip>
 					<formatterOptions>
 						<googleJavaFormat.aosp>true</googleJavaFormat.aosp>
 						<googleJavaFormat.fixImportsOnly>false</googleJavaFormat.fixImportsOnly>