Skip to content

Commit d9b6a35

Browse files
committed
build(format): disable Groovy-Eclipse formatter to fix CI serialization failure
Spotless' greclipse() step hits a known Spotless/Gradle bug when its internal state is fingerprinted for the build cache on fresh CI caches: If the initializer was null, then one of roundtripStateInternal or equalityStateInternal should be non-null, and neither was Replacing greclipse() with basic whitespace steps (leadingTabsToSpaces, trimTrailingWhitespace, endWithNewline) avoids the problematic Eclipse P2 serialization path while still keeping .gradle files tidy. Also adds the missing trailing newline to gradle/semantic-version.gradle. See: diffplug/spotless#2402
1 parent 8722598 commit d9b6a35

3 files changed

Lines changed: 12 additions & 9 deletions

File tree

build-logic/conventions/build.gradle.kts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,7 @@ repositories {
1313

1414
dependencies {
1515
implementation("org.jetbrains.kotlin:kotlin-stdlib")
16-
// Pinned to 8.5.1 because 8.6.0+ triggers a Spotless/Gradle serialization bug with
17-
// the Groovy-Eclipse formatter on fresh Gradle user homes / CI caches:
18-
// "If the initializer was null, then one of roundtripStateInternal or
19-
// equalityStateInternal should be non-null, and neither was"
20-
// See https://github.com/diffplug/spotless/issues/2402 and related issues.
21-
implementation("com.diffplug.spotless:spotless-plugin-gradle:8.5.1")
16+
implementation("com.diffplug.spotless:spotless-plugin-gradle:8.7.0")
2217
}
2318

2419
gradlePlugin {

build-logic/conventions/src/main/kotlin/com/datadoghq/profiler/SpotlessConventionPlugin.kt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,15 @@ class SpotlessConventionPlugin : Plugin<Project> {
2727
}
2828

2929
// Groovy Gradle files
30+
// NOTE: greclipse() is disabled because it triggers a Spotless/Gradle serialization
31+
// bug on fresh CI caches (see diffplug/spotless#2402). Basic whitespace formatting
32+
// is still applied.
3033
spotless.groovyGradle {
3134
toggleOffOn()
3235
target("*.gradle", "gradle/**/*.gradle")
33-
greclipse().configFile("$configPath/enforcement/spotless-groovy.properties")
36+
leadingTabsToSpaces()
37+
trimTrailingWhitespace()
38+
endWithNewline()
3439
}
3540

3641
// Kotlin Gradle files
@@ -54,7 +59,10 @@ class SpotlessConventionPlugin : Plugin<Project> {
5459
if (!skipJavaExclude) {
5560
excludeJava()
5661
}
57-
greclipse().configFile("$configPath/enforcement/spotless-groovy.properties")
62+
// greclipse() disabled: see the groovyGradle block above.
63+
leadingTabsToSpaces()
64+
trimTrailingWhitespace()
65+
endWithNewline()
5866
}
5967
}
6068

gradle/semantic-version.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version = "0.58.0"
1+
version = "0.58.0"

0 commit comments

Comments
 (0)