Skip to content

Commit 95c9d0c

Browse files
committed
Add spotless-check
1 parent d6359e1 commit 95c9d0c

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.github/workflows/spotless-check.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: mvn spotless:check (Formatting)
2+
3+
4+
on:
5+
pull_request:
6+
types: [opened, reopened, synchronize]
7+
8+
jobs:
9+
format-check:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
pull-requests: write
13+
steps:
14+
- uses: actions/checkout@v3
15+
- name: Set up JDK 17
16+
uses: actions/setup-java@v3
17+
with:
18+
java-version: '17'
19+
distribution: 'temurin'
20+
- name: spotless:check
21+
run: mvn spotless:check
22+
- uses: mshick/add-pr-comment@v2
23+
if: always()
24+
with:
25+
message-success: |
26+
Formatting check succeeded!
27+
message-failure: |
28+
**This Pull Request has failed the formatting check**
29+
30+
Please run `mvn spotless:apply` or `mvn clean install -DskipTests` to fix the formatting issues.
31+
32+
You can automate this auto-formatting process to execute on the git pre-push hook, by installing [pre-commit](https://pre-commit.com/) and then calling `pre-commit install --hook-type pre-push`. This will cause formatting to run automatically whenever you push.
33+

0 commit comments

Comments
 (0)