Skip to content

Commit c7e9183

Browse files
committed
spotless fixes: format for devs, verify only on CI
1 parent 3629da2 commit c7e9183

2 files changed

Lines changed: 27 additions & 14 deletions

File tree

.github/workflows/loom-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ jobs:
4545
restore-keys: ${{ runner.os }}-m2
4646

4747
- name: Build with Maven
48-
run: mvn -B verify --file pom.xml -DargLine="--enable-preview"
48+
run: mvn -B verify --file pom.xml -DargLine="--enable-preview" -P '!dev'

pom.xml

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,24 +55,15 @@
5555
<artifactId>spotless-maven-plugin</artifactId>
5656
<version>3.0.0</version>
5757
<configuration>
58-
<java>
59-
<eclipse />
60-
</java>
58+
<java><eclipse/></java>
6159
</configuration>
60+
6261
<executions>
63-
<execution>
64-
<id>apply-formatting</id>
65-
<phase>compile</phase>
66-
<goals>
67-
<goal>apply</goal>
68-
</goals>
69-
</execution>
62+
<!-- ONLY check in CI -->
7063
<execution>
7164
<id>check-formatting</id>
7265
<phase>verify</phase>
73-
<goals>
74-
<goal>check</goal>
75-
</goals>
66+
<goals><goal>check</goal></goals>
7667
</execution>
7768
</executions>
7869
</plugin>
@@ -121,4 +112,26 @@
121112
</plugins>
122113
</pluginManagement>
123114
</build>
115+
<profiles>
116+
<profile>
117+
<id>dev</id>
118+
<activation><activeByDefault>true</activeByDefault></activation>
119+
<build>
120+
<plugins>
121+
<plugin>
122+
<groupId>com.diffplug.spotless</groupId>
123+
<artifactId>spotless-maven-plugin</artifactId>
124+
<executions>
125+
<!-- only local dev: auto-format before compile -->
126+
<execution>
127+
<id>apply-formatting</id>
128+
<phase>compile</phase>
129+
<goals><goal>apply</goal></goals>
130+
</execution>
131+
</executions>
132+
</plugin>
133+
</plugins>
134+
</build>
135+
</profile>
136+
</profiles>
124137
</project>

0 commit comments

Comments
 (0)