Skip to content

Commit 5a545ae

Browse files
MaicolAntalitibor-universe
authored andcommitted
Add spotless plugin (google#2537)
* Adds the `spotless` plugin * Excludes `Java17` files Excludes: - Java17RecordTest.java - Java17RecordReflectionTest.java * Fixes formatting in `pom.xml`
1 parent ce310bb commit 5a545ae

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

pom.xml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,49 @@
143143
</execution>
144144
</executions>
145145
</plugin>
146+
<!-- Spotless plugin: keeps the code formatted following the google-java-styleguide -->
147+
<plugin>
148+
<groupId>com.diffplug.spotless</groupId>
149+
<artifactId>spotless-maven-plugin</artifactId>
150+
<version>2.40.0</version>
151+
<executions>
152+
<execution>
153+
<goals>
154+
<goal>check</goal>
155+
</goals>
156+
</execution>
157+
</executions>
158+
<configuration>
159+
<formats>
160+
<format>
161+
<includes>
162+
<include>*.md</include>
163+
<include>.gitignore</include>
164+
</includes>
165+
<trimTrailingWhitespace/>
166+
<endWithNewline/>
167+
<indent>
168+
<spaces>true</spaces>
169+
<spacesPerTab>4</spacesPerTab>
170+
</indent>
171+
</format>
172+
</formats>
173+
<java>
174+
<excludes>
175+
<exclude>src/test/java/com/google/gson/functional/Java17RecordTest.java</exclude>
176+
<exclude>src/test/java/com/google/gson/native_test/Java17RecordReflectionTest.java</exclude>
177+
</excludes>
178+
<googleJavaFormat>
179+
<style>GOOGLE</style>
180+
<reflowLongStrings>true</reflowLongStrings>
181+
<formatJavadoc>true</formatJavadoc>
182+
</googleJavaFormat>
183+
<importOrder/>
184+
<removeUnusedImports/>
185+
<formatAnnotations/> <!-- Puts type annotations immediately before types. -->.
186+
</java>
187+
</configuration>
188+
</plugin>
146189
</plugins>
147190

148191
<pluginManagement>

0 commit comments

Comments
 (0)