Skip to content

Commit

Permalink
Use spotless plugin for formating (#308)
Browse files Browse the repository at this point in the history
  • Loading branch information
rnett authored May 23, 2021
1 parent 3648a96 commit ceae489
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .mvn/jvm.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
14 changes: 14 additions & 0 deletions license-header
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=======================================================================
*/
57 changes: 44 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -44,6 +44,7 @@
<maven.javadoc.skip>true</maven.javadoc.skip>
<maven.source.skip>true</maven.source.skip>
<gpg.skip>true</gpg.skip>
<spotless.version>2.10.3</spotless.version>
</properties>

<repositories>
Expand Down Expand Up @@ -102,19 +103,19 @@
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-core</artifactId>
<version>${jmh.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
<version>${jmh.version}</version>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-core</artifactId>
<version>${jmh.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
<version>${jmh.version}</version>
<scope>test</scope>
</dependency>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down Expand Up @@ -299,6 +300,36 @@
<updateMatchingVersions>true</updateMatchingVersions>
</configuration>
</plugin>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>${spotless.version}</version>
<configuration>
<ratchetFrom>origin/master</ratchetFrom>

<lineEndings/>
<java>
<googleJavaFormat/>

<removeUnusedImports/>

<licenseHeader>
<file>./license-header</file>
</licenseHeader>
</java>
</configuration>

<executions>
<execution>
<!-- Runs in initialize phase to fail fast in case of formatting issues (should be before codegen).-->
<id>spotless-check</id>
<phase>initialize</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
Expand Down
12 changes: 12 additions & 0 deletions tensorflow-core/tensorflow-core-generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,18 @@
</archive>
</configuration>
</plugin>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>${spotless.version}</version>
<configuration>
<java>
<excludes>
<exclude>src/main/java/org/tensorflow/proto/framework/**</exclude>
</excludes>
</java>
</configuration>
</plugin>
</plugins>
</build>
</project>

0 comments on commit ceae489

Please sign in to comment.