Skip to content

Commit

Permalink
Add spotless plugin (#2537)
Browse files Browse the repository at this point in the history
* Adds the `spotless` plugin

* Excludes `Java17` files

Excludes:
- Java17RecordTest.java
- Java17RecordReflectionTest.java

* Fixes formatting in `pom.xml`
  • Loading branch information
MaicolAntali committed Nov 13, 2023
1 parent c2a0e46 commit d58e2c9
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,49 @@
</execution>
</executions>
</plugin>
<!-- Spotless plugin: keeps the code formatted following the google-java-styleguide -->
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.40.0</version>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<configuration>
<formats>
<format>
<includes>
<include>*.md</include>
<include>.gitignore</include>
</includes>
<trimTrailingWhitespace/>
<endWithNewline/>
<indent>
<spaces>true</spaces>
<spacesPerTab>4</spacesPerTab>
</indent>
</format>
</formats>
<java>
<excludes>
<exclude>src/test/java/com/google/gson/functional/Java17RecordTest.java</exclude>
<exclude>src/test/java/com/google/gson/native_test/Java17RecordReflectionTest.java</exclude>
</excludes>
<googleJavaFormat>
<style>GOOGLE</style>
<reflowLongStrings>true</reflowLongStrings>
<formatJavadoc>true</formatJavadoc>
</googleJavaFormat>
<importOrder/>
<removeUnusedImports/>
<formatAnnotations/> <!-- Puts type annotations immediately before types. -->.
</java>
</configuration>
</plugin>
</plugins>

<pluginManagement>
Expand Down

0 comments on commit d58e2c9

Please sign in to comment.