Skip to content

Commit b602745

Browse files
committed
Merge branch 'main' into I2428
2 parents 7b8c3e0 + 399bf33 commit b602745

File tree

291 files changed

+1925
-2165
lines changed

Some content is hidden

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

291 files changed

+1925
-2165
lines changed

.github/workflows/changelog-print.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ jobs:
1515
java-version: 21
1616
distribution: 'temurin'
1717
- name: gradle caching
18-
uses: gradle/actions/setup-gradle@v4
18+
uses: gradle/actions/setup-gradle@v5
1919
- run: ./gradlew changelogPrint

.github/workflows/ci.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
distribution: "temurin"
2828
java-version: 21
2929
- name: gradle caching
30-
uses: gradle/actions/setup-gradle@v4
30+
uses: gradle/actions/setup-gradle@v5
3131
- name: spotlessCheck
3232
run: ./gradlew spotlessCheck
3333
- name: rewriteDryRun
@@ -64,7 +64,7 @@ jobs:
6464
distribution: "temurin"
6565
java-version: ${{ matrix.jre }}
6666
- name: gradle caching
67-
uses: gradle/actions/setup-gradle@v4
67+
uses: gradle/actions/setup-gradle@v5
6868
- name: build (maven-only)
6969
if: matrix.kind == 'maven'
7070
run: ./gradlew :plugin-maven:build -x spotlessCheck -x rewriteDryRun
@@ -97,9 +97,25 @@ jobs:
9797
cd ..
9898
./gradlew testIdea
9999
- name: junit result
100-
uses: mikepenz/action-junit-report@v5
100+
uses: mikepenz/action-junit-report@v6
101101
if: always() # always run even if the previous step fails
102102
with:
103103
check_name: JUnit ${{ matrix.kind }} ${{ matrix.jre }} ${{ matrix.os }}
104104
report_paths: '*/build/test-results/*/TEST-*.xml'
105105
check_retries: true
106+
107+
# Status check that is required in branch protection rules.
108+
final-status:
109+
needs:
110+
- build
111+
runs-on: ubuntu-latest
112+
if: always()
113+
steps:
114+
- name: Check
115+
run: |
116+
results=$(tr -d '\n' <<< '${{ toJSON(needs.*.result) }}')
117+
if ! grep -q -v -E '(failure|cancelled)' <<< "$results"; then
118+
echo "One or more required jobs failed"
119+
exit 1
120+
fi
121+
echo "All required jobs completed successfully."

.github/workflows/claude.yml

Lines changed: 0 additions & 64 deletions
This file was deleted.

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050

5151
# Initializes the CodeQL tools for scanning.
5252
- name: Initialize CodeQL
53-
uses: github/codeql-action/init@v3
53+
uses: github/codeql-action/init@v4
5454
with:
5555
languages: ${{ matrix.language }}
5656
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -61,7 +61,7 @@ jobs:
6161
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
6262
# If this step fails, then you should remove it and run the build manually (see below)
6363
- name: Autobuild
64-
uses: github/codeql-action/autobuild@v3
64+
uses: github/codeql-action/autobuild@v4
6565

6666
# ℹ️ Command-line programs to run using the OS shell.
6767
# 📚 https://git.io/JvXDl
@@ -75,4 +75,4 @@ jobs:
7575
# make release
7676

7777
- name: Perform CodeQL Analysis
78-
uses: github/codeql-action/analyze@v3
78+
uses: github/codeql-action/analyze@v4

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
java-version: 21
4444
distribution: 'temurin'
4545
- name: gradle caching
46-
uses: gradle/actions/setup-gradle@v4
46+
uses: gradle/actions/setup-gradle@v5
4747
- name: git fetch origin main
4848
run: git fetch origin main
4949
- name: publish all

CHANGES.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ 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+
### Changes
14+
- Bump default `ktfmt` version to latest `0.58` -> `0.59`. ([#2681](https://github.com/diffplug/spotless/pull/2681)
15+
- Bump default `jackson` version to latest `2.20.0` -> `2.20.1`. ([#2730](https://github.com/diffplug/spotless/pull/2730))
16+
- Bump default `cleanthat` version to latest `2.23` -> `2.24`. ([#2620](https://github.com/diffplug/spotless/pull/2620))
17+
- **POTENTIALLY BREAKING** Removed support for `ktlint` versions below 1.0. ([#2711](https://github.com/diffplug/spotless/pull/2711))
18+
### Fixed
19+
- palantirJavaFormat is no longer arbitrarily set to outdated versions on Java 17, latest available version is always used ([#2686](https://github.com/diffplug/spotless/pull/2686) fixes [#2685](https://github.com/diffplug/spotless/issues/2685))
20+
### Added
21+
- Add a `forbidModuleImports` API for java ([#2679](https://github.com/diffplug/spotless/issues/2679))
22+
- new options to customize Flexmark, e.g. to allow YAML front matter ([#2616](https://github.com/diffplug/spotless/issues/2616))
1323

1424
## [4.0.0] - 2025-09-24
1525
### Changes

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ lib('java.GoogleJavaFormatStep') +'{{yes}} | {{yes}}
8585
lib('java.ImportOrderStep') +'{{yes}} | {{yes}} | {{yes}} | {{no}} |',
8686
lib('java.PalantirJavaFormatStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
8787
lib('java.RemoveUnusedImportsStep') +'{{yes}} | {{yes}} | {{yes}} | {{no}} |',
88+
lib('java.ForbidWildcardImportsStep') +'{{yes}} | {{yes}} | {{yes}} | {{no}} |',
89+
lib('java.ForbidModuleImportsStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
8890
extra('java.EclipseJdtFormatterStep') +'{{yes}} | {{yes}} | {{yes}} | {{no}} |',
8991
lib('java.FormatAnnotationsStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
9092
lib('java.CleanthatJavaStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
@@ -140,6 +142,8 @@ lib('yaml.JacksonYamlStep') +'{{yes}} | {{yes}}
140142
| [`java.ImportOrderStep`](lib/src/main/java/com/diffplug/spotless/java/ImportOrderStep.java) | :+1: | :+1: | :+1: | :white_large_square: |
141143
| [`java.PalantirJavaFormatStep`](lib/src/main/java/com/diffplug/spotless/java/PalantirJavaFormatStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
142144
| [`java.RemoveUnusedImportsStep`](lib/src/main/java/com/diffplug/spotless/java/RemoveUnusedImportsStep.java) | :+1: | :+1: | :+1: | :white_large_square: |
145+
| [`java.ForbidWildcardImportsStep`](lib/src/main/java/com/diffplug/spotless/java/ForbidWildcardImportsStep.java) | :+1: | :+1: | :+1: | :white_large_square: |
146+
| [`java.ForbidModuleImportsStep`](lib/src/main/java/com/diffplug/spotless/java/ForbidModuleImportsStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
143147
| [`java.EclipseJdtFormatterStep`](lib-extra/src/main/java/com/diffplug/spotless/extra/java/EclipseJdtFormatterStep.java) | :+1: | :+1: | :+1: | :white_large_square: |
144148
| [`java.FormatAnnotationsStep`](lib/src/main/java/com/diffplug/spotless/java/FormatAnnotationsStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
145149
| [`java.CleanthatJavaStep`](lib/src/main/java/com/diffplug/spotless/java/CleanthatJavaStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
@@ -193,7 +197,6 @@ Once someone has filled in one square of the formatter/build system matrix, it's
193197
- Thanks to [Matthias Balke](https://github.com/matthiasbalke) for [adding support for Antlr](https://github.com/diffplug/spotless/pull/328).
194198
- Thanks to [Matthias Andreas Benkard](https://github.com/benkard) for adding support for google-java-format 1.8+ ([#563](https://github.com/diffplug/spotless/pull/563))
195199
- Thanks to [Thomas Broyer](https://github.com/tbroyer) for adding support for google-java-format's [skip-reflowing-long-strings option](https://github.com/diffplug/spotless/pull/929).
196-
- Thanks to [Ranadeep Polavarapu](https://github.com/RanadeepPolavarapu) for adding support for ktfmt ([#569](https://github.com/diffplug/spotless/pull/569))
197200
- Thanks to [Hakanai](https://github.com/hakanai) for adding [wildcards last support to the import sorter](https://github.com/diffplug/spotless/pull/956).
198201
- Thanks to [Kevin Brooks](https://github.com/k-brooks) for [updating all eclipse-based formatters to 4.13](https://github.com/diffplug/spotless/pull/482) and [fixing Groovy for multiproject](https://github.com/diffplug/spotless/issues/877).
199202
- Thanks to [Dylan Baroody](https://github.com/dylanbaroody) for fixing [sql formatting support for JDBI bind list params](https://github.com/diffplug/spotless/pull/955).

build.gradle

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ repositories {
1212
apply from: rootProject.file('gradle/java-publish.gradle')
1313
apply from: rootProject.file('gradle/changelog.gradle')
1414
allprojects {
15+
apply from: rootProject.file('gradle/error-prone.gradle')
1516
apply from: rootProject.file('gradle/rewrite.gradle')
1617
apply from: rootProject.file('gradle/spotless.gradle')
1718
}
@@ -30,6 +31,10 @@ spotless {
3031
}
3132

3233
dependencies {
33-
rewrite(platform("org.openrewrite.recipe:rewrite-recipe-bom:3.15.0"))
34-
rewrite("org.openrewrite.recipe:rewrite-migrate-java:3.18.0")
34+
rewrite(platform('org.openrewrite.recipe:rewrite-recipe-bom:3.18.0'))
35+
rewrite('org.openrewrite.recipe:rewrite-migrate-java:3.19.0')
36+
rewrite('org.openrewrite.recipe:rewrite-java-security:3.19.2')
37+
rewrite('org.openrewrite.recipe:rewrite-rewrite:0.14.0')
38+
rewrite('org.openrewrite.recipe:rewrite-static-analysis:2.19.0')
39+
rewrite('org.openrewrite.recipe:rewrite-third-party:0.31.1')
3540
}

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ VER_SLF4J=[1.6,2.0[
2929

3030
# Used in multiple places
3131
VER_DURIAN=1.2.0
32-
VER_JGIT=7.3.0.202506031305-r
33-
VER_JUNIT=5.13.4
32+
VER_JGIT=7.4.0.202509020913-r
33+
VER_JUNIT=5.14.1
3434
VER_ASSERTJ=3.27.6
3535
VER_MOCKITO=5.20.0
3636
VER_SELFIE=2.5.4

gradle/error-prone.gradle

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
apply plugin: 'net.ltgt.errorprone'
2+
3+
dependencies {
4+
errorprone('com.google.errorprone:error_prone_core:2.42.0')
5+
errorprone('tech.picnic.error-prone-support:error-prone-contrib:0.26.0')
6+
}
7+
8+
tasks.withType(JavaCompile).configureEach {
9+
options.errorprone {
10+
disable( // consider fix, or reasoning.
11+
'FunctionalInterfaceMethodChanged',
12+
'JavaxInjectOnAbstractMethod',
13+
'OverridesJavaxInjectableMethod',
14+
)
15+
error(
16+
'AmbiguousJsonCreator',
17+
'AssertJNullnessAssertion',
18+
'AutowiredConstructor',
19+
'CanonicalAnnotationSyntax',
20+
'CollectorMutability',
21+
'ConstantNaming',
22+
'DirectReturn',
23+
'EmptyMethod',
24+
'ExplicitArgumentEnumeration',
25+
'ExplicitEnumOrdering',
26+
'IdentityConversion',
27+
'ImmutablesSortedSetComparator',
28+
'IsInstanceLambdaUsage',
29+
'MockitoMockClassReference',
30+
'MockitoStubbing',
31+
'NestedOptionals',
32+
'PrimitiveComparison',
33+
'RedundantStringConversion',
34+
'RedundantStringEscape',
35+
'ReturnValueIgnored',
36+
'SelfAssignment',
37+
'StringJoin',
38+
'StringJoining',
39+
'UnnecessarilyFullyQualified',
40+
'UnnecessaryLambda',
41+
)
42+
// bug: this only happens when the file is dirty.
43+
// might be an up2date (caching) issue, as file is currently in corrupt state.
44+
// ForbidGradleInternal(import org.gradle.api.internal.project.ProjectInternal;)
45+
errorproneArgs.add('-XepExcludedPaths:' +
46+
'.*/SelfTest.java|' +
47+
'.*/GradleIntegrationHarness.java'
48+
)
49+
}
50+
}

0 commit comments

Comments
 (0)