[HUDI-296] Explore use of spotless to auto fix formatting errors (#945)
- Add spotless format fixing to project - One time reformatting for conformity - Build fails for formatting changes and mvn spotless:apply autofixes them
This commit is contained in:
30
pom.xml
30
pom.xml
@@ -99,6 +99,7 @@
|
||||
<skipITs>${skipTests}</skipITs>
|
||||
<skipUTs>${skipTests}</skipUTs>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<main.basedir>${project.basedir}</main.basedir>
|
||||
</properties>
|
||||
|
||||
<scm>
|
||||
@@ -155,7 +156,7 @@
|
||||
<failOnWarning>false</failOnWarning>
|
||||
<sourceDirectory>${project.basedir}/src/main/scala</sourceDirectory>
|
||||
<testSourceDirectory>${project.basedir}/src/test/scala</testSourceDirectory>
|
||||
<configLocation>${maven.multiModuleProjectDirectory}/style/scalastyle-config.xml</configLocation>
|
||||
<configLocation>${main.basedir}/style/scalastyle-config.xml</configLocation>
|
||||
<outputEncoding>UTF-8</outputEncoding>
|
||||
</configuration>
|
||||
<executions>
|
||||
@@ -167,6 +168,33 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>com.diffplug.spotless</groupId>
|
||||
<artifactId>spotless-maven-plugin</artifactId>
|
||||
<version>1.24.3</version>
|
||||
<configuration>
|
||||
<java>
|
||||
<eclipse>
|
||||
<file>${main.basedir}/style/eclipse-java-google-style.xml</file>
|
||||
<version>4.10.0</version>
|
||||
</eclipse>
|
||||
</java>
|
||||
<scala>
|
||||
<!--<endWithNewLine/>-->
|
||||
<trimTrailingWhitespace/>
|
||||
</scala>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<!-- Runs in compile phase to fail fast in case of formatting issues.-->
|
||||
<id>spotless-check</id>
|
||||
<phase>compile</phase>
|
||||
<goals>
|
||||
<goal>check</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
|
||||
Reference in New Issue
Block a user