Skip to content

Commit 730051e

Browse files
Add spotless maven plugin
* with rules that more or less match current style
1 parent 04205c4 commit 730051e

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

.github/workflows/maven.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,7 @@ jobs:
2626
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
2727
restore-keys: ${{ runner.os }}-m2
2828
- name: Build with Maven
29-
run: ./mvnw clean install -Dgpg.skip
29+
run: ./mvnw clean package -Dgpg.skip
30+
- name: Check style with Spotless
31+
run: ./mvnw spotless:check
3032

pom.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
<wire.version>3.7.1</wire.version>
7474
<wire.plugin.version>3.0.2</wire.plugin.version>
7575
<wire.suffix></wire.suffix>
76+
<spotless.version>2.41.1</spotless.version>
7677
</properties>
7778

7879
<dependencyManagement>
@@ -266,6 +267,25 @@
266267
</execution>
267268
</executions>
268269
</plugin>
270+
<plugin>
271+
<groupId>com.diffplug.spotless</groupId>
272+
<artifactId>spotless-maven-plugin</artifactId>
273+
<version>${spotless.version}</version>
274+
<configuration>
275+
<java>
276+
<excludes>
277+
<exclude>**/_*.java</exclude>
278+
</excludes>
279+
<googleJavaFormat>
280+
<version>1.19.1</version>
281+
<style>AOSP</style>
282+
<reflowLongStrings>true</reflowLongStrings>
283+
<formatJavadoc>false</formatJavadoc>
284+
</googleJavaFormat>
285+
<removeUnusedImports />
286+
</java>
287+
</configuration>
288+
</plugin>
269289
</plugins>
270290
</build>
271291

0 commit comments

Comments
 (0)