nebula-java
nebula-java copied to clipboard
Use spotless to format code to standard
Its great to have checkstyle for a community project its even better if the build can format the code to the standard.
My suggestion would be to use spotless https://github.com/diffplug/spotless/tree/main/plugin-maven
Applied this to project and then used checkstyle:check to verify and they are different.
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>${spotless.version}</version>
<executions>
<execution>
<goals>
<goal>apply</goal>
</goals>
<phase>compile</phase>
</execution>
</executions>
<configuration>
<!-- define a language-specific format -->
<java>
<importOrder/>
<removeUnusedImports/>
<googleJavaFormat>
<version>1.15.0</version>
<style>AOSP</style>
</googleJavaFormat>
</java>
</configuration>
</plugin>
related pr https://github.com/vesoft-inc/nebula-java/pull/486