Skip to content

Commit

Permalink
Add spotless plugin (google#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 authored and tibor-universe committed Aug 17, 2024
1 parent ce310bb commit 5a545ae
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 @@ -143,6 +143,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 5a545ae

Please sign in to comment.