Skip to content

Commit 7a25005

Browse files
Added Google Java Style
1 parent de0b588 commit 7a25005

File tree

3 files changed

+16
-33
lines changed

3 files changed

+16
-33
lines changed

.github/workflows/checkstyle.yml

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,24 @@
1-
# https://github.com/google/google-java-format
2-
name: Google Java Format
1+
name: Code Formatter
32

4-
on:
5-
push:
6-
branches: [ master ]
7-
pull_request:
8-
branches: [ master ]
3+
on: [push]
94

105
jobs:
11-
build:
12-
6+
lint:
137
runs-on: ubuntu-latest
14-
158
steps:
16-
- uses: actions/checkout@v2
17-
- name: Set up JDK 12
18-
uses: actions/setup-java@v1
19-
with:
20-
java-version: 12
21-
- name: Gooogle Java Formatter
22-
run: |
23-
wget https://github.com/google/google-java-format/releases/download/google-java-format-1.9/google-java-format-1.9-all-deps.jar -O formatter.jar
24-
java -jar formatter.jar --replace --set-exit-if-changed $(find . -type f -name "*.java" | grep ".*/src/.*java")
25-
git diff
26-
- name: Commit formatted changes
9+
- uses: actions/checkout@v2
10+
- uses: actions/setup-python@v2
11+
- name: Set up JDK 12
12+
uses: actions/setup-java@v1
13+
with:
14+
java-version: 12
15+
- run: wget https://github.com/google/google-java-format/releases/download/google-java-format-1.9/google-java-format-1.9-all-deps.jar -O formatter.jar
16+
- run: java -jar formatter.jar --replace --set-exit-if-changed $(find . -type f -name "*.java" | grep ".*/src/.*java")
17+
- name: Commit Format changes
2718
if: failure()
2819
run: |
2920
git config --global user.name github-actions
3021
git config --global user.email '${GITHUB_ACTOR}@users.noreply.github.com'
3122
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
32-
git commit -am "Formatted with Google Java Format"
33-
git push --force origin HEAD:$GITHUB_REF
23+
git commit -am "Formatted with Google Java Formatter"
24+
git push --force origin HEAD:$GITHUB_REF

.github/workflows/gradle.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33

44
name: Java CI with Gradle
55

6-
on:
7-
push:
8-
branches: [ master ]
9-
pull_request:
10-
branches: [ master ]
6+
on: [push]
117

128
jobs:
139
build:

.github/workflows/maven.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33

44
name: Java CI with Maven
55

6-
on:
7-
push:
8-
branches: [ master ]
9-
pull_request:
10-
branches: [ master ]
6+
on: [push]
117

128
jobs:
139
build:

0 commit comments

Comments
 (0)