Skip to content

Commit

Permalink
Introduce "skip.format.code" to skip code formatting by default (#1213)
Browse files Browse the repository at this point in the history
  • Loading branch information
rzo1 committed May 7, 2024
1 parent 0315f95 commit e944db1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit e944db1

Please sign in to comment.