File tree Expand file tree Collapse file tree 3 files changed +80
-0
lines changed Expand file tree Collapse file tree 3 files changed +80
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Java Code Format
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - ' sdk-automation/models'
7
+
8
+ jobs :
9
+ format :
10
+ if : ${{ github.event.commits != null && !startsWith(github.event.head_commit.message, 'style(fmt)') }}
11
+ permissions :
12
+ contents : write
13
+ runs-on : ubuntu-latest
14
+
15
+ steps :
16
+ - uses : actions/checkout@v4
17
+ with :
18
+ token : ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }}
19
+
20
+ - name : Set up JDK
21
+ uses : actions/setup-java@v4
22
+ with :
23
+ java-version : ' 20'
24
+ distribution : ' adopt'
25
+
26
+ - name : Cache Maven packages
27
+ uses : actions/cache@v3
28
+ with :
29
+ path : ~/.m2
30
+ key : ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
31
+ restore-keys : |
32
+ ${{ runner.os }}-m2-
33
+
34
+ - name : Run Spotless Apply
35
+ run : mvn spotless:apply
36
+
37
+ - name : Commit and Push Changes
38
+ run : |
39
+ git config user.name AdyenAutomationBot
40
+ git config user.email "${{ secrets.ADYEN_AUTOMATION_BOT_EMAIL }}"
41
+ git add .
42
+ if git diff --cached --quiet; then
43
+ echo "No changes to commit."
44
+ else
45
+ git commit -m "style(fmt): code formatted"
46
+ git push
47
+ fi
Original file line number Diff line number Diff line change 133
133
<module name =" ParenPad" />
134
134
<module name =" TypecastParenPad" />
135
135
<module name =" WhitespaceAfter" />
136
+ <!-- disable rule to align with Spotless formatting
136
137
<module name="WhitespaceAround"/>
138
+ -->
137
139
138
140
<!-- Modifier Checks -->
139
141
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
Original file line number Diff line number Diff line change 191
191
</instructions >
192
192
</configuration >
193
193
</plugin >
194
+ <!-- Format code -->
195
+ <plugin >
196
+ <groupId >com.diffplug.spotless</groupId >
197
+ <artifactId >spotless-maven-plugin</artifactId >
198
+ <version >2.44.4</version >
199
+ <executions >
200
+ <execution >
201
+ <goals >
202
+ <goal >apply</goal >
203
+ </goals >
204
+ </execution >
205
+ </executions >
206
+ <configuration >
207
+ <java >
208
+ <includes >
209
+ <include >src/main/java/**/*.java</include >
210
+ <include >src/test/java/**/*.java</include >
211
+ </includes >
212
+ <googleJavaFormat >
213
+ <version >1.19.2</version >
214
+ <style >GOOGLE</style >
215
+ <formatJavadoc >true</formatJavadoc >
216
+ </googleJavaFormat >
217
+ <importOrder /> <!-- standard import order -->
218
+ <removeUnusedImports >
219
+ <engine >google-java-format</engine >
220
+ </removeUnusedImports >
221
+ </java >
222
+ </configuration >
223
+ </plugin >
224
+
194
225
</plugins >
195
226
</build >
196
227
<dependencies >
You can’t perform that action at this time.
0 commit comments