Only run spotless:check as part of the lifecyle

Users can run spotless:apply as they see fit.
This commit is contained in:
Liam Newman
2021-02-26 14:44:50 -08:00
parent a04ab45abc
commit f08299b134
3 changed files with 20 additions and 10 deletions

1
.gitattributes vendored Normal file
View File

@@ -0,0 +1 @@
*.java text eol=lf

View File

@@ -7,7 +7,6 @@ We love getting PRs, but we hate asking people for the same basic changes every
- [ ] Push your changes to a branch other than `master`. Create your PR from that branch. - [ ] Push your changes to a branch other than `master`. Create your PR from that branch.
- [ ] Add JavaDocs and other comments - [ ] Add JavaDocs and other comments
- [ ] Write tests that run and pass in CI. See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to capture snapshot data. - [ ] Write tests that run and pass in CI. See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to capture snapshot data.
- [ ] Run `mvn clean compile` locally. This may reformat your code, commit those changes.
- [ ] Run `mvn -D enable-ci clean install site` locally. If this command doesn't succeed, your change will not pass CI. - [ ] Run `mvn -D enable-ci clean install site` locally. If this command doesn't succeed, your change will not pass CI.
# When creating a PR: # When creating a PR:

26
pom.xml
View File

@@ -39,7 +39,6 @@
<hamcrest.version>2.2</hamcrest.version> <hamcrest.version>2.2</hamcrest.version>
<okhttp3.version>4.4.1</okhttp3.version> <okhttp3.version>4.4.1</okhttp3.version>
<okio.version>2.5.0</okio.version> <okio.version>2.5.0</okio.version>
<spotless-maven-plugin.goal>apply</spotless-maven-plugin.goal>
<!-- Using this as the minimum bar for code coverage. Adding methods without covering them will fail this. --> <!-- Using this as the minimum bar for code coverage. Adding methods without covering them will fail this. -->
<jacoco.coverage.target.bundle.method>0.70</jacoco.coverage.target.bundle.method> <jacoco.coverage.target.bundle.method>0.70</jacoco.coverage.target.bundle.method>
<jacoco.coverage.target.class.method>0.50</jacoco.coverage.target.class.method> <jacoco.coverage.target.class.method>0.50</jacoco.coverage.target.class.method>
@@ -325,13 +324,14 @@
<plugin> <plugin>
<groupId>com.diffplug.spotless</groupId> <groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId> <artifactId>spotless-maven-plugin</artifactId>
<version>2.7.0</version> <version>2.8.1</version>
<executions> <executions>
<execution> <execution>
<id>spotless-check</id> <id>spotless-check</id>
<phase>process-sources</phase> <!-- runs in verify phase by default -->
<goals> <goals>
<goal>${spotless-maven-plugin.goal}</goal> <!-- can be disabled using -Dspotless.check.skip=true -->
<goal>check</goal>
</goals> </goals>
</execution> </execution>
</executions> </executions>
@@ -574,7 +574,6 @@
<properties> <properties>
<!-- Only fail code coverage on non-windows machines --> <!-- Only fail code coverage on non-windows machines -->
<jacoco.haltOnFailure>true</jacoco.haltOnFailure> <jacoco.haltOnFailure>true</jacoco.haltOnFailure>
<spotless-maven-plugin.goal>check</spotless-maven-plugin.goal>
</properties> </properties>
</profile> </profile>
<profile> <profile>
@@ -590,14 +589,25 @@
<groupId>org.jacoco</groupId> <groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId> <artifactId>jacoco-maven-plugin</artifactId>
</plugin> </plugin>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<executions>
<execution>
<id>spotless-check</id>
<!-- In CI, run check early in the build -->
<phase>process-sources</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins> </plugins>
</build> </build>
</profile> </profile>
<profile> <profile>
<id>release</id> <id>release</id>
<properties>
<spotless-maven-plugin.goal>check</spotless-maven-plugin.goal>
</properties>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>