Skip to content

Commit c219cf7

Browse files
committed
chore: remove spotless from build and docs
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
1 parent a930df4 commit c219cf7

8 files changed

Lines changed: 8 additions & 78 deletions

File tree

AGENTS.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,16 @@ mise run test
2121
# Run all tests including integration tests
2222
mise run test-all
2323

24-
# Format code with Google Java Format
25-
mise run format
26-
2724
# Run a single test class
2825
./mvnw test -Dtest=CounterTest \
29-
-Dspotless.check.skip=true \
3026
-Dcoverage.skip=true -Dcheckstyle.skip=true
3127

3228
# Run a single test method
3329
./mvnw test -Dtest=CounterTest#testIncrement \
34-
-Dspotless.check.skip=true \
3530
-Dcoverage.skip=true -Dcheckstyle.skip=true
3631

3732
# Run tests in a specific module
3833
./mvnw test -pl prometheus-metrics-core \
39-
-Dspotless.check.skip=true \
4034
-Dcoverage.skip=true -Dcheckstyle.skip=true
4135

4236
# Regenerate protobuf classes (after protobuf dep update)
@@ -86,7 +80,7 @@ Pre-built instrumentations:
8680

8781
## Code Style
8882

89-
- **Formatter**: Google Java Format (enforced via Spotless)
83+
- **Formatter**: Google Java Format (enforced via flint)
9084
- **Line length**: 100 characters
9185
(enforced for ALL files including Markdown, Java, YAML)
9286
- **Indentation**: 2 spaces
@@ -109,7 +103,7 @@ commits. CI will fail if these checks fail.
109103

110104
- **ALWAYS** run `mise run build` after modifying Java files
111105
to ensure:
112-
- Code formatting (Spotless with Google Java Format)
106+
- Code formatting via flint
113107
- Static analysis (`Error Prone` with NullAway)
114108
- Checkstyle validation
115109
- Build succeeds (tests are skipped;

CONTRIBUTING.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,9 @@ git push --force-with-lease
4343

4444
## Formatting
4545

46-
This repository uses [Google Java Format](https://github.com/google/google-java-format) to format
47-
the code.
46+
This repository uses flint to run formatting and lint checks.
4847

49-
Run `./mvnw spotless:apply` to format the code (only changed files) before committing.
50-
51-
Or run all the linters:
48+
Run all the linters:
5249

5350
`mise run lint`
5451

@@ -79,15 +76,14 @@ mise --cd .mise/envs/native run native-test
7976

8077
### Avoid failures while running tests
8178

82-
- Use `-Dspotless.check.skip=true` to skip the formatting check during development.
8379
- Use `-Dcoverage.skip=true` to skip the coverage check during development.
8480
- Use `-Dcheckstyle.skip=true` to skip the checkstyle check during development.
8581
- Use `-Dwarnings=-nowarn` to skip the warnings during development.
8682

8783
Combine all with
8884

8985
```shell
90-
./mvnw install -DskipTests -Dspotless.check.skip=true -Dcoverage.skip=true \
86+
./mvnw install -DskipTests -Dcoverage.skip=true \
9187
-Dcheckstyle.skip=true -Dwarnings=-nowarn
9288
```
9389

integration-tests/it-spring-boot-smoke-test/pom.xml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -168,24 +168,6 @@
168168
<!-- editorconfig-checker-enable -->
169169
</configuration>
170170
</plugin>
171-
<plugin>
172-
<groupId>com.diffplug.spotless</groupId>
173-
<artifactId>spotless-maven-plugin</artifactId>
174-
<version>3.3.0</version>
175-
<configuration>
176-
<java>
177-
<googleJavaFormat/>
178-
</java>
179-
</configuration>
180-
<executions>
181-
<execution>
182-
<phase>verify</phase>
183-
<goals>
184-
<goal>check</goal>
185-
</goals>
186-
</execution>
187-
</executions>
188-
</plugin>
189171
</plugins>
190172
</build>
191173
</profile>

mise.toml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,28 +32,22 @@ run = "./mvnw clean install"
3232
env.REQUIRE_PROTO_UP_TO_DATE = "true"
3333
env.PROTO_GENERATION = "true"
3434

35-
[tasks.format]
36-
description = "format source code"
37-
# Use fully-qualified plugin goal and deactivate the examples-and-integration-tests
38-
# profile because standalone example modules don't inherit the spotless plugin.
39-
run = "./mvnw com.diffplug.spotless:spotless-maven-plugin:apply -P '!examples-and-integration-tests'"
40-
4135
[tasks.clean]
4236
description = "clean all modules"
4337
run = "./mvnw clean"
4438

4539
[tasks.compile]
4640
description = "bare compile, ignoring formatting and linters"
47-
run = "./mvnw install -DskipTests -Dspotless.check.skip=true -Dcoverage.skip=true -Dcheckstyle.skip=true -Dwarnings=-nowarn"
41+
run = "./mvnw install -DskipTests -Dcoverage.skip=true -Dcheckstyle.skip=true -Dwarnings=-nowarn"
4842

4943
[tasks.generate]
5044
description = "regenerate protobuf sources"
51-
run = "./mvnw clean install -DskipTests -Dspotless.check.skip=true -Dcoverage.skip=true -Dcheckstyle.skip=true -Dwarnings=-nowarn"
45+
run = "./mvnw clean install -DskipTests -Dcoverage.skip=true -Dcheckstyle.skip=true -Dwarnings=-nowarn"
5246
env.PROTO_GENERATION = "true"
5347

5448
[tasks.test]
5549
description = "run unit tests, ignoring formatting and linters"
56-
run = "./mvnw test -Dspotless.check.skip=true -Dcoverage.skip=true -Dcheckstyle.skip=true -Dwarnings=-nowarn"
50+
run = "./mvnw test -Dcoverage.skip=true -Dcheckstyle.skip=true -Dwarnings=-nowarn"
5751

5852
[tasks.test-all]
5953
description = "run all tests"

pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
<jacoco.line-coverage>0.70</jacoco.line-coverage>
3030
<checkstyle.skip>false</checkstyle.skip>
3131
<coverage.skip>false</coverage.skip>
32-
<spotless.skip>false</spotless.skip>
3332
<javadoc.skip>false</javadoc.skip>
3433
<warnings>-Werror</warnings>
3534
</properties>

prometheus-metrics-bom/pom.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@
1717
Bill of Materials for the Prometheus Metrics library
1818
</description>
1919

20-
<properties>
21-
<spotless.skip>true</spotless.skip>
22-
</properties>
23-
2420
<dependencyManagement>
2521
<dependencies>
2622
<dependency>

prometheus-metrics-otel-support/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
<properties>
2222
<checkstyle.skip>true</checkstyle.skip>
2323
<coverage.skip>true</coverage.skip>
24-
<spotless.skip>true</spotless.skip>
2524
<javadoc.skip>true</javadoc.skip>
2625
</properties>
2726

prometheus-metrics-parent/pom.xml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
<properties>
1717
<checkstyle.skip>true</checkstyle.skip>
1818
<coverage.skip>true</coverage.skip>
19-
<spotless.skip>true</spotless.skip>
2019
<javadoc.skip>true</javadoc.skip>
2120
</properties>
2221

@@ -70,35 +69,6 @@
7069
</build>
7170

7271
<profiles>
73-
<profile>
74-
<id>java17-plus</id>
75-
<activation>
76-
<jdk>[17,)</jdk>
77-
</activation>
78-
<build>
79-
<plugins>
80-
<plugin>
81-
<groupId>com.diffplug.spotless</groupId>
82-
<artifactId>spotless-maven-plugin</artifactId>
83-
<version>3.3.0</version>
84-
<configuration>
85-
<java>
86-
<googleJavaFormat/>
87-
</java>
88-
<skip>${spotless.skip}</skip>
89-
</configuration>
90-
<executions>
91-
<execution>
92-
<phase>verify</phase>
93-
<goals>
94-
<goal>check</goal>
95-
</goals>
96-
</execution>
97-
</executions>
98-
</plugin>
99-
</plugins>
100-
</build>
101-
</profile>
10272
<profile>
10373
<id>release</id>
10474
<build>

0 commit comments

Comments
 (0)