Skip to content

Commit e0ea424

Browse files
committed
Merge branch 'main' into fix-expandWildcardImports
2 parents cefe990 + a91afd1 commit e0ea424

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+676
-108
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Scheduled Cleanup 🧹
2+
on:
3+
schedule:
4+
- cron: '0 16 * * 3'
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}
7+
cancel-in-progress: true
8+
jobs:
9+
sanity:
10+
name: Sanity 🦢
11+
runs-on: ubuntu-latest
12+
env:
13+
buildcacheuser: ${{ secrets.BUILDCACHE_USER }}
14+
buildcachepass: ${{ secrets.BUILDCACHE_PASS }}
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v6
18+
with:
19+
fetch-depth: 0
20+
- uses: actions/setup-java@v5
21+
with:
22+
distribution: temurin
23+
java-version: 21
24+
- name: Gradle Setup 🐘
25+
uses: gradle/actions/setup-gradle@v5
26+
- name: Error Prone 🚧️
27+
run: ./gradlew assemble -Derror-prone=true
28+
- name: OpenRewrite ☑️ # 4m 55s (2 min compile, 3 min rewrite)
29+
run: ./gradlew rewriteDryRun

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ This document is intended for Spotless developers.
1010
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `1.27.0`).
1111

1212
## [Unreleased]
13+
### Added
14+
- Add `tabletest-formatter` support for Java and Kotlin. ([#2860](https://github.com/diffplug/spotless/pull/2860))
15+
### Fixed
16+
- Fix the ability to specify a wildcard version (`*`) for external formatter executables, which did not work. ([#2848](https://github.com/diffplug/spotless/pull/2848))
1317

1418
## [4.3.0] - 2026-01-27
1519
### Added

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ lib('java.ForbidModuleImportsStep') +'{{yes}} | {{yes}}
9191
extra('java.EclipseJdtFormatterStep') +'{{yes}} | {{yes}} | {{yes}} | {{no}} |',
9292
lib('java.FormatAnnotationsStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
9393
lib('java.CleanthatJavaStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
94+
lib('java.TableTestFormatterStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
9495
lib('json.gson.GsonStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
9596
lib('json.JacksonJsonStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
9697
lib('json.JsonSimpleStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
@@ -149,6 +150,7 @@ lib('yaml.JacksonYamlStep') +'{{yes}} | {{yes}}
149150
| [`java.EclipseJdtFormatterStep`](lib-extra/src/main/java/com/diffplug/spotless/extra/java/EclipseJdtFormatterStep.java) | :+1: | :+1: | :+1: | :white_large_square: |
150151
| [`java.FormatAnnotationsStep`](lib/src/main/java/com/diffplug/spotless/java/FormatAnnotationsStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
151152
| [`java.CleanthatJavaStep`](lib/src/main/java/com/diffplug/spotless/java/CleanthatJavaStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
153+
| [`java.TableTestFormatterStep`](lib/src/main/java/com/diffplug/spotless/java/TableTestFormatterStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
152154
| [`json.gson.GsonStep`](lib/src/main/java/com/diffplug/spotless/json/gson/GsonStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
153155
| [`json.JacksonJsonStep`](lib/src/main/java/com/diffplug/spotless/json/JacksonJsonStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
154156
| [`json.JsonSimpleStep`](lib/src/main/java/com/diffplug/spotless/json/JsonSimpleStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ apply from: rootProject.file('gradle/java-publish.gradle')
1010
apply from: rootProject.file('gradle/changelog.gradle')
1111
apply from: rootProject.file('gradle/rewrite.gradle')
1212
allprojects {
13+
apply from: rootProject.file('gradle/error-prone.gradle')
1314
apply from: rootProject.file('gradle/spotless.gradle')
1415
}
1516
apply from: rootProject.file('gradle/spotless-freshmark.gradle')

gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ VER_SLF4J=[1.6,2.0[
3030
# Used in multiple places
3131
VER_DURIAN=1.2.0
3232
VER_JGIT=7.5.0.202512021534-r
33-
VER_JUNIT=6.0.2
34-
VER_ASSERTJ=3.27.6
35-
VER_MOCKITO=5.21.0
33+
VER_JUNIT=6.0.3
34+
VER_ASSERTJ=3.27.7
35+
VER_MOCKITO=5.22.0
3636
VER_SELFIE=2.5.5
3737
VER_SOLSTICE=1.8.1

gradle/error-prone.gradle

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ apply plugin: 'net.ltgt.errorprone'
44

55
tasks.withType(JavaCompile).configureEach {
66
options.errorprone {
7+
getenv('error-prone')?.toBoolean() ? enable() : disable()
78
disableAllWarnings = true // https://github.com/diffplug/spotless/issues/2745 https://github.com/google/error-prone/issues/5365
89
disable(
9-
// consider fix, or reasoning.
1010
'AnnotateFormatMethod', // We don`t want to use ErrorProne's annotations.
11-
'DoNotCallSuggester', // We don`t want to use ErrorProne's annotations.
1211
'FunctionalInterfaceMethodChanged',
1312
'ImmutableEnumChecker', // We don`t want to use ErrorProne's annotations.
1413
'InlineMeSuggester', // We don`t want to use ErrorProne's annotations.
@@ -26,17 +25,7 @@ tasks.withType(JavaCompile).configureEach {
2625
// bug: this only happens when the file is dirty.
2726
// might be an up2date (caching) issue, as file is currently in corrupt state.
2827
// ForbidGradleInternal(import
29-
excludedPaths.set(
30-
'.*/GradleIntegrationHarness.java|'+
31-
'.*/SelfTest.java'
32-
)
33-
if (!getenv().containsKey('CI') && getenv('IN_PLACE')?.toBoolean()) {
34-
errorproneArgs.addAll(
35-
'-XepPatchLocation:IN_PLACE',
36-
'-XepPatchChecks:' +
37-
'MissingOverride'
38-
)
39-
}
28+
excludedPaths.set('.*/GradleIntegrationHarness.java')
4029
}
4130
}
4231

gradle/rewrite.gradle

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
if (!project.hasProperty('rewrite')) {
2-
return
3-
}
41
apply plugin: 'org.openrewrite.rewrite'
52
rewrite {
63
activeRecipe('com.diffplug.spotless.openrewrite.SanityCheck')
@@ -24,8 +21,7 @@ rewrite {
2421
failOnDryRunResults = true
2522
}
2623
dependencies {
27-
rewrite('org.openrewrite.recipe:rewrite-migrate-java:3.22.0')
28-
rewrite('org.openrewrite.recipe:rewrite-rewrite:0.16.0')
29-
rewrite('org.openrewrite.recipe:rewrite-static-analysis:2.22.0')
30-
rewrite('org.openrewrite.recipe:rewrite-third-party:0.31.2')
24+
rewrite('org.openrewrite.recipe:rewrite-migrate-java:3.28.0')
25+
rewrite('org.openrewrite.recipe:rewrite-static-analysis:2.28.0')
26+
rewrite('org.openrewrite.recipe:rewrite-third-party:0.36.0')
3127
}

gradle/wrapper/gradle-wrapper.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=0d585f69da091fc5b2beced877feab55a3064d43b8a1d46aeb07996b0915e0e0
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.0-bin.zip
3+
distributionSha256Sum=b266d5ff6b90eada6dc3b20cb090e3731302e553a27c5d3e4df1f0d76beaff06
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
55
networkTimeout=10000
66
validateDistributionUrl=true
77
zipStoreBase=GRADLE_USER_HOME

lib-extra/src/test/java/com/diffplug/spotless/TestP2Provisioner.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,12 @@ private static class CacheKey implements Serializable {
118118

119119
@Override
120120
public boolean equals(Object o) {
121-
if (this == o)
121+
if (this == o) {
122122
return true;
123-
if (o == null || getClass() != o.getClass())
123+
}
124+
if (o == null || getClass() != o.getClass()) {
124125
return false;
126+
}
125127
CacheKey cacheKey = (CacheKey) o;
126128
return useMavenCentral == cacheKey.useMavenCentral &&
127129
Objects.equals(p2Repos, cacheKey.p2Repos) &&

lib/build.gradle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ def NEEDS_GLUE = [
2626
'sortPom',
2727
'zjsonPatch',
2828
]
29+
// tableTestFormatter requires Java 21+
30+
if (JavaVersion.current() >= JavaVersion.VERSION_21) {
31+
NEEDS_GLUE << 'tableTestFormatter'
32+
}
33+
2934
for (glue in NEEDS_GLUE) {
3035
sourceSets.register(glue) {
3136
compileClasspath += sourceSets.main.output
@@ -122,6 +127,10 @@ dependencies {
122127
// sortPom
123128
sortPomCompileOnly 'com.github.ekryd.sortpom:sortpom-sorter:4.0.0'
124129
sortPomCompileOnly 'org.slf4j:slf4j-api:2.0.17'
130+
// tableTestFormatter (Java 21+ only)
131+
if (JavaVersion.current() >= JavaVersion.VERSION_21) {
132+
tableTestFormatterCompileOnly 'org.tabletest:tabletest-formatter-core:1.0.1'
133+
}
125134
// zjsonPatch
126135
zjsonPatchCompileOnly 'com.flipkart.zjsonpatch:zjsonpatch:0.4.16'
127136
}

0 commit comments

Comments
 (0)