File tree Expand file tree Collapse file tree 5 files changed +47
-3
lines changed Expand file tree Collapse file tree 5 files changed +47
-3
lines changed Original file line number Diff line number Diff line change 3333 run : ./gradlew spotlessCheck
3434 - name : assemble testClasses
3535 run : ./gradlew assemble testClasses
36+ rewriteDryRun :
37+ name : rewriteDryRun
38+ runs-on : ubuntu-latest
39+ env :
40+ buildcacheuser : ${{ secrets.BUILDCACHE_USER }}
41+ buildcachepass : ${{ secrets.BUILDCACHE_PASS }}
42+ steps :
43+ - name : Checkout
44+ uses : actions/checkout@v4
45+ with :
46+ fetch-depth : 0
47+ - uses : actions/setup-java@v4
48+ with :
49+ distribution : " temurin"
50+ java-version : 21
51+ - name : gradle caching
52+ uses : gradle/actions/setup-gradle@v4
53+ - name : rewriteDryRun
54+ run : ./gradlew rewriteDryRun --build-cache --info
3655 build :
37- needs : sanityCheck
56+ needs : [ sanityCheck, rewriteDryRun]
3857 strategy :
3958 fail-fast : false
4059 matrix :
@@ -66,10 +85,10 @@ jobs:
6685 uses : gradle/actions/setup-gradle@v4
6786 - name : build (maven-only)
6887 if : matrix.kind == 'maven'
69- run : ./gradlew :plugin-maven:build -x spotlessCheck
88+ run : ./gradlew :plugin-maven:build -x spotlessCheck -x rewriteDryRun
7089 - name : build (everything-but-maven)
7190 if : matrix.kind == 'gradle'
72- run : ./gradlew build -x spotlessCheck -PSPOTLESS_EXCLUDE_MAVEN=true
91+ run : ./gradlew build -x spotlessCheck -x rewriteDryRun - PSPOTLESS_EXCLUDE_MAVEN=true
7392 - name : test npm
7493 if : matrix.kind == 'npm'
7594 run : ./gradlew testNpm
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
1616 * Adds support for worktrees (fixes [ #1765 ] ( https://github.com/diffplug/spotless/issues/1765 ) )
1717* Bump default ` google-java-format ` version to latest ` 1.24.0 ` -> ` 1.28.0 ` . ([ #2345 ] ( https://github.com/diffplug/spotless/pull/2345 ) )
1818* Bump default ` ktlint ` version to latest ` 1.5.0 ` -> ` 1.7.1 ` . ([ #2555 ] ( https://github.com/diffplug/spotless/pull/2555 ) )
19+ * Add ` rewrite ` support ([ #2588 ] ( https://github.com/diffplug/spotless/pull/2588 ) )
1920
2021## [ 3.3.1] - 2025-07-21
2122### Fixed
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ apply from: rootProject.file('gradle/java-publish.gradle')
1313apply from : rootProject. file(' gradle/changelog.gradle' )
1414allprojects {
1515 apply from : rootProject. file(' gradle/spotless.gradle' )
16+ apply from : rootProject. file(' gradle/rewrite.gradle' )
1617}
1718apply from : rootProject. file(' gradle/spotless-freshmark.gradle' )
1819
@@ -27,3 +28,7 @@ spotless {
2728 endWithNewline()
2829 }
2930}
31+
32+ dependencies {
33+ rewrite(platform(" org.openrewrite.recipe:rewrite-recipe-bom:latest.release" ))
34+ }
Original file line number Diff line number Diff line change 1+ apply plugin : ' org.openrewrite.rewrite'
2+
3+ rewrite {
4+ // activeRecipe("org.openrewrite.java.RemoveUnusedImports")
5+ // bugs
6+ exclusions. add(" **AJacksonFormatterFunc.java" )
7+ exclusions. add(" **NpmPathResolver.java" )
8+ exclusions. add(" **NpmTestsWithoutNpmInstallationTest_gradle_node_plugin_example_*.gradle" )
9+ exclusions. add(" **gradle/changelog.gradle" )
10+ exclusions. add(" **gradle/java-publish.gradle" )
11+ exclusions. add(" **lib-extra/build.gradle" )
12+ exclusions. add(" **lib/build.gradle" )
13+ exclusions. add(" **package-info.java" )
14+ exclusions. add(" **plugin-maven/build.gradle" )
15+ exclusions. add(" **settings.gradle" )
16+ exportDatatables = true
17+ failOnDryRunResults = true
18+ }
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ plugins {
2323 id ' com.gradle.develocity' version ' 3.19.2'
2424 // https://github.com/equodev/equo-ide/blob/main/plugin-gradle/CHANGELOG.md
2525 id ' dev.equo.ide' version ' 1.7.8' apply false
26+ id ' org.openrewrite.rewrite' version ' 7.12.1' apply false
2627}
2728
2829dependencyResolutionManagement {
You can’t perform that action at this time.
0 commit comments