Add spotless-check
This commit is contained in:
33
.github/workflows/spotless-check.yml
vendored
Normal file
33
.github/workflows/spotless-check.yml
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
name: mvn spotless:check (Formatting)
|
||||
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, reopened, synchronize]
|
||||
|
||||
jobs:
|
||||
format-check:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
- name: spotless:check
|
||||
run: mvn spotless:check
|
||||
- uses: mshick/add-pr-comment@v2
|
||||
if: always()
|
||||
with:
|
||||
message-success: |
|
||||
Formatting check succeeded!
|
||||
message-failure: |
|
||||
**This Pull Request has failed the formatting check**
|
||||
|
||||
Please run `mvn spotless:apply` or `mvn clean install -DskipTests` to fix the formatting issues.
|
||||
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user