Skip to content

Commit f527b03

Browse files
committed
Merge branch 'main' into feat/maven-ide-hook
2 parents c6e55bd + 6c1df6d commit f527b03

File tree

120 files changed

+3357
-884
lines changed

Some content is hidden

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

120 files changed

+3357
-884
lines changed

.github/workflows/changelog-print.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
name: changelogPrint
1111
steps:
12-
- uses: actions/checkout@v3
12+
- uses: actions/checkout@v4
1313
- name: jdk 11
1414
uses: actions/setup-java@v3
1515
with:

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
buildcachepass: ${{ secrets.BUILDCACHE_PASS }}
2121
steps:
2222
- name: Checkout
23-
uses: actions/checkout@v3
23+
uses: actions/checkout@v4
2424
with:
2525
fetch-depth: 0
2626
- name: Install JDK 11
@@ -59,7 +59,7 @@ jobs:
5959
runs-on: ${{ matrix.os }}
6060
steps:
6161
- name: Checkout
62-
uses: actions/checkout@v3
62+
uses: actions/checkout@v4
6363
- name: Install JDK ${{ matrix.distribution }} ${{ matrix.java_version }}
6464
uses: actions/setup-java@v3
6565
with:

.github/workflows/codeql-analysis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737

3838
steps:
3939
- name: Checkout repository
40-
uses: actions/checkout@v3
40+
uses: actions/checkout@v4
4141
with:
4242
# We must fetch at least the immediate parents so that if this is
4343
# a pull request then we can checkout the head.

.github/workflows/deploy.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
ORG_GRADLE_PROJECT_gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
3737
ORG_GRADLE_PROJECT_gpg_key64: ${{ secrets.GPG_KEY64 }}
3838
steps:
39-
- uses: actions/checkout@v3
39+
- uses: actions/checkout@v4
4040
- name: jdk 11
4141
uses: actions/setup-java@v3
4242
with:

.github/workflows/gradle-wrapper-validation.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ jobs:
1919
name: "Validation"
2020
runs-on: ubuntu-latest
2121
steps:
22-
- uses: actions/checkout@v3
22+
- uses: actions/checkout@v4
2323
- uses: gradle/wrapper-validation-action@v1

CHANGES.md

+16-2
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,29 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
1111

1212
## [Unreleased]
1313
### Added
14+
* Support for biome. The Rome project [was renamed to Biome](https://biomejs.dev/blog/annoucing-biome/).
15+
The configuration is still the same, but you should switch to the new `biome` tag / function and adjust
16+
the version accordingly. ([#1804](https://github.com/diffplug/spotless/issues/1804)).
17+
* Support for `google-java-format`'s `skip-javadoc-formatting` option. ([#1793](https://github.com/diffplug/spotless/pull/1793))
18+
* Support configuration of mirrors for P2 repositories in maven DSL ([#1697](https://github.com/diffplug/spotless/issues/1697)).
19+
### Fixed
20+
* Fix support for plugins when using Prettier version `3.0.0` and newer. ([#1802](https://github.com/diffplug/spotless/pull/1802))
21+
### Changes
22+
* Bump default `flexmark` version to latest `0.64.0` -> `0.64.8`. ([#1801](https://github.com/diffplug/spotless/pull/1801))
23+
* Bump default `ktlint` version to latest `0.50.0` -> `1.0.0`. ([#1808](https://github.com/diffplug/spotless/pull/1808))
24+
25+
## [2.41.0] - 2023-08-29
26+
### Added
1427
* Add a `jsonPatch` step to `json` formatter configurations. This allows patching of JSON documents using [JSON Patches](https://jsonpatch.com). ([#1753](https://github.com/diffplug/spotless/pull/1753))
1528
* Support GJF own import order. ([#1780](https://github.com/diffplug/spotless/pull/1780))
1629
### Fixed
1730
* Use latest versions of popular style guides for `eslint` tests to fix failing `useEslintXoStandardRules` test. ([#1761](https://github.com/diffplug/spotless/pull/1761), [#1756](https://github.com/diffplug/spotless/issues/1756))
18-
* Add support for `prettier` version `3.0.0` and newer. ([#1760]https://github.com/diffplug/spotless/pull/1760), [#1751](https://github.com/diffplug/spotless/issues/1751))
19-
* Fix npm install calls when npm cache is not up-to-date. ([#1760]https://github.com/diffplug/spotless/pull/1760), [#1750](https://github.com/diffplug/spotless/issues/1750))
31+
* Add support for `prettier` version `3.0.0` and newer. ([#1760](https://github.com/diffplug/spotless/pull/1760), [#1751](https://github.com/diffplug/spotless/issues/1751))
32+
* Fix npm install calls when npm cache is not up-to-date. ([#1760](https://github.com/diffplug/spotless/pull/1760), [#1750](https://github.com/diffplug/spotless/issues/1750))
2033
### Changes
2134
* Bump default `eslint` version to latest `8.31.0` -> `8.45.0` ([#1761](https://github.com/diffplug/spotless/pull/1761))
2235
* Bump default `prettier` version to latest (v2) `2.8.1` -> `2.8.8`. ([#1760](https://github.com/diffplug/spotless/pull/1760))
36+
* Bump default `greclipse` version to latest `4.27` -> `4.28`. ([#1775](https://github.com/diffplug/spotless/pull/1775))
2337

2438
## [2.40.0] - 2023-07-17
2539
### Added

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,14 @@ lib('kotlin.KtLintStep') +'{{yes}} | {{yes}}
9494
lib('kotlin.KtfmtStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
9595
lib('kotlin.DiktatStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
9696
lib('markdown.FreshMarkStep') +'{{yes}} | {{no}} | {{no}} | {{no}} |',
97-
lib('markdown.FlexmarkStep') +'{{no}} | {{yes}} | {{no}} | {{no}} |',
97+
lib('markdown.FlexmarkStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
9898
lib('npm.EslintFormatterStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
9999
lib('npm.PrettierFormatterStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
100100
lib('npm.TsFmtFormatterStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
101101
lib('pom.SortPomStepStep') +'{{no}} | {{yes}} | {{no}} | {{no}} |',
102102
lib('protobuf.BufStep') +'{{yes}} | {{no}} | {{no}} | {{no}} |',
103103
lib('python.BlackStep') +'{{yes}} | {{no}} | {{no}} | {{no}} |',
104-
lib('rome.RomeStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
104+
lib('biome.BiomeStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
105105
lib('scala.ScalaFmtStep') +'{{yes}} | {{yes}} | {{yes}} | {{no}} |',
106106
lib('sql.DBeaverSQLFormatterStep') +'{{yes}} | {{yes}} | {{yes}} | {{no}} |',
107107
extra('wtp.EclipseWtpFormatterStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
@@ -146,14 +146,14 @@ lib('yaml.JacksonYamlStep') +'{{yes}} | {{yes}}
146146
| [`kotlin.KtfmtStep`](lib/src/main/java/com/diffplug/spotless/kotlin/KtfmtStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
147147
| [`kotlin.DiktatStep`](lib/src/main/java/com/diffplug/spotless/kotlin/DiktatStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
148148
| [`markdown.FreshMarkStep`](lib/src/main/java/com/diffplug/spotless/markdown/FreshMarkStep.java) | :+1: | :white_large_square: | :white_large_square: | :white_large_square: |
149-
| [`markdown.FlexmarkStep`](lib/src/main/java/com/diffplug/spotless/markdown/FlexmarkStep.java) | :white_large_square: | :+1: | :white_large_square: | :white_large_square: |
149+
| [`markdown.FlexmarkStep`](lib/src/main/java/com/diffplug/spotless/markdown/FlexmarkStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
150150
| [`npm.EslintFormatterStep`](lib/src/main/java/com/diffplug/spotless/npm/EslintFormatterStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
151151
| [`npm.PrettierFormatterStep`](lib/src/main/java/com/diffplug/spotless/npm/PrettierFormatterStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
152152
| [`npm.TsFmtFormatterStep`](lib/src/main/java/com/diffplug/spotless/npm/TsFmtFormatterStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
153153
| [`pom.SortPomStepStep`](lib/src/main/java/com/diffplug/spotless/pom/SortPomStepStep.java) | :white_large_square: | :+1: | :white_large_square: | :white_large_square: |
154154
| [`protobuf.BufStep`](lib/src/main/java/com/diffplug/spotless/protobuf/BufStep.java) | :+1: | :white_large_square: | :white_large_square: | :white_large_square: |
155155
| [`python.BlackStep`](lib/src/main/java/com/diffplug/spotless/python/BlackStep.java) | :+1: | :white_large_square: | :white_large_square: | :white_large_square: |
156-
| [`rome.RomeStep`](lib/src/main/java/com/diffplug/spotless/rome/RomeStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
156+
| [`biome.BiomeStep`](lib/src/main/java/com/diffplug/spotless/biome/BiomeStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
157157
| [`scala.ScalaFmtStep`](lib/src/main/java/com/diffplug/spotless/scala/ScalaFmtStep.java) | :+1: | :+1: | :+1: | :white_large_square: |
158158
| [`sql.DBeaverSQLFormatterStep`](lib/src/main/java/com/diffplug/spotless/sql/DBeaverSQLFormatterStep.java) | :+1: | :+1: | :+1: | :white_large_square: |
159159
| [`wtp.EclipseWtpFormatterStep`](lib-extra/src/main/java/com/diffplug/spotless/extra/wtp/EclipseWtpFormatterStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |

_ext/gradle/java-setup.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ tasks.withType(JavaCompile).configureEach {
1919
dependencies {
2020
testImplementation "org.junit.jupiter:junit-jupiter:${VER_JUNIT}"
2121
testImplementation "org.assertj:assertj-core:${VER_ASSERTJ}"
22-
testImplementation project(':testlib')
22+
testImplementation projects.testlib
2323
}
2424

2525
tasks.withType(Test).configureEach {

gradle.properties

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ VER_SLF4J=[1.6,2.0[
2929

3030
# Used in multiple places
3131
VER_DURIAN=1.2.0
32-
VER_JGIT=6.6.0.202305301015-r
33-
VER_JUNIT=5.9.3
32+
VER_JGIT=6.7.0.202309050840-r
33+
VER_JUNIT=5.10.0
3434
VER_ASSERTJ=3.24.2
35-
VER_MOCKITO=5.3.1
35+
VER_MOCKITO=5.5.0

lib-extra/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ version = rootProject.spotlessChangelog.versionNext
77
apply from: rootProject.file('gradle/java-setup.gradle')
88
apply from: rootProject.file('gradle/java-publish.gradle')
99

10-
String VER_SOLSTICE = '1.3.1'
10+
String VER_SOLSTICE = '1.7.3'
1111
dependencies {
12-
api project(':lib')
12+
api projects.lib
1313
// misc useful utilities
1414
implementation "com.diffplug.durian:durian-core:${VER_DURIAN}"
1515
implementation "com.diffplug.durian:durian-collect:${VER_DURIAN}"
@@ -20,7 +20,7 @@ dependencies {
2020
implementation "dev.equo.ide:solstice:${VER_SOLSTICE}"
2121

2222
// testing
23-
testImplementation project(':testlib')
23+
testImplementation projects.testlib
2424
testImplementation "org.junit.jupiter:junit-jupiter:${VER_JUNIT}"
2525
testImplementation "org.assertj:assertj-core:${VER_ASSERTJ}"
2626
testImplementation "com.diffplug.durian:durian-testlib:${VER_DURIAN}"

lib-extra/src/main/java/com/diffplug/spotless/extra/EquoBasedStepBuilder.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@
1515
*/
1616
package com.diffplug.spotless.extra;
1717

18+
import static java.util.stream.Collectors.toMap;
19+
1820
import java.io.File;
1921
import java.io.IOException;
2022
import java.io.Serializable;
2123
import java.util.ArrayList;
24+
import java.util.Collection;
2225
import java.util.List;
2326
import java.util.Map;
2427
import java.util.Properties;
@@ -76,6 +79,10 @@ public void setP2Mirrors(Map<String, String> p2Mirrors) {
7679
this.p2Mirrors = Map.copyOf(p2Mirrors);
7780
}
7881

82+
public void setP2Mirrors(Collection<P2Mirror> p2Mirrors) {
83+
this.p2Mirrors = p2Mirrors.stream().collect(toMap(P2Mirror::getPrefix, P2Mirror::getUrl));
84+
}
85+
7986
/** Returns the FormatterStep (whose state will be calculated lazily). */
8087
public FormatterStep build() {
8188
return FormatterStep.createLazy(formatterName, this::get, stateToFormatter);
@@ -110,7 +117,7 @@ EquoBasedStepBuilder.State get() throws Exception {
110117
}
111118
var classpath = new ArrayList<File>();
112119
var mavenDeps = new ArrayList<String>();
113-
mavenDeps.add("dev.equo.ide:solstice:1.3.1");
120+
mavenDeps.add("dev.equo.ide:solstice:1.7.3");
114121
mavenDeps.add("com.diffplug.durian:durian-swt.os:4.2.0");
115122
mavenDeps.addAll(query.getJarsOnMavenCentral());
116123
classpath.addAll(mavenProvisioner.provisionWithTransitives(false, mavenDeps));
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Copyright 2023 DiffPlug
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.diffplug.spotless.extra;
17+
18+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
19+
20+
@SuppressFBWarnings("UWF_UNWRITTEN_FIELD")
21+
public class P2Mirror {
22+
23+
private String prefix;
24+
private String url;
25+
26+
public String getPrefix() {
27+
return prefix;
28+
}
29+
30+
public String getUrl() {
31+
return url;
32+
}
33+
}

lib-extra/src/main/java/com/diffplug/spotless/extra/groovy/GrEclipseFormatterStep.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public final class GrEclipseFormatterStep {
3232
private GrEclipseFormatterStep() {}
3333

3434
private static final String NAME = "eclipse groovy formatter";
35-
private static final Jvm.Support<String> JVM_SUPPORT = Jvm.<String> support(NAME).add(11, "4.26").add(17, "4.27");
35+
private static final Jvm.Support<String> JVM_SUPPORT = Jvm.<String> support(NAME).add(11, "4.26").add(17, "4.28");
3636

3737
public static String defaultVersion() {
3838
return JVM_SUPPORT.getRecommendedFormatterVersion();
@@ -50,7 +50,9 @@ protected P2Model model(String version) {
5050
throw new IllegalArgumentException("4.8 is the oldest version we support, this was " + version);
5151
}
5252
String greclipseVersion;
53-
if (eVersion >= 18) {
53+
if (eVersion >= 28) {
54+
greclipseVersion = "5." + (eVersion - 28) + ".0";
55+
} else if (eVersion >= 18) {
5456
greclipseVersion = "4." + (eVersion - 18) + ".0";
5557
} else {
5658
greclipseVersion = "3." + (eVersion - 8) + ".0";

lib/build.gradle

+6-1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ versionCompatibility {
4848
'0.48.0',
4949
'0.49.0',
5050
'0.50.0',
51+
'1.0.0',
5152
]
5253
targetSourceSetName = 'ktlint'
5354
}
@@ -104,10 +105,14 @@ dependencies {
104105
compatKtLint0Dot49Dot0CompileAndTestOnly 'com.pinterest.ktlint:ktlint-rule-engine:0.49.0'
105106
compatKtLint0Dot49Dot0CompileAndTestOnly 'com.pinterest.ktlint:ktlint-ruleset-standard:0.49.0'
106107
compatKtLint0Dot49Dot0CompileAndTestOnly 'org.slf4j:slf4j-api:2.0.0'
107-
// ktlint latest supported version
108+
// ktlint previous supported version
108109
compatKtLint0Dot50Dot0CompileAndTestOnly 'com.pinterest.ktlint:ktlint-rule-engine:0.50.0'
109110
compatKtLint0Dot50Dot0CompileAndTestOnly 'com.pinterest.ktlint:ktlint-ruleset-standard:0.50.0'
110111
compatKtLint0Dot50Dot0CompileAndTestOnly 'org.slf4j:slf4j-api:2.0.0'
112+
// ktlint latest supported version
113+
compatKtLint1Dot0Dot0CompileAndTestOnly 'com.pinterest.ktlint:ktlint-rule-engine:1.0.0'
114+
compatKtLint1Dot0Dot0CompileAndTestOnly 'com.pinterest.ktlint:ktlint-ruleset-standard:1.0.0'
115+
compatKtLint1Dot0Dot0CompileAndTestOnly 'org.slf4j:slf4j-api:2.0.0'
111116
// palantirJavaFormat
112117
palantirJavaFormatCompileOnly 'com.palantir.javaformat:palantir-java-format:1.1.0' // this version needs to stay compilable against Java 8 for CI Job testNpm
113118
// scalafmt

0 commit comments

Comments
 (0)