Skip to content

Commit e10dbdc

Browse files
committed
Merge branch 'main' into renovate/com.facebook-ktfmt-0.x
2 parents 82390ae + 587c8d8 commit e10dbdc

File tree

87 files changed

+4278
-235
lines changed

Some content is hidden

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

87 files changed

+4278
-235
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ indent_size = 2
1414

1515
[*.java]
1616
# Doc: https://youtrack.jetbrains.com/issue/IDEA-170643#focus=streamItem-27-3708697.0-0
17-
ij_java_imports_layout = java.**,|,javax.**,|,org.**,|,com.**,|,com.diffplug.**,|,*
17+
ij_java_imports_layout = $*,|,java.**,|,javax.**,|,org.**,|,com.**,|,com.diffplug.**,|,*
1818
ij_java_use_single_class_imports = true
1919
ij_java_class_count_to_use_import_on_demand = 999
2020
ij_java_names_count_to_use_import_on_demand = 999

CHANGES.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,17 @@ 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-
1413
### Added
1514
* `Jvm.Support` now accepts `-SNAPSHOT` versions, treated as the non`-SNAPSHOT`. ([#1583](https://github.com/diffplug/spotless/issues/1583))
15+
* Support Rome as a formatter for JavaScript and TypeScript code. Adds a new `rome` step to `javascript` and `typescript` formatter configurations. ([#1663](https://github.com/diffplug/spotless/pull/1663))
16+
* Add semantics-aware Java import ordering (i.e. sort by package, then class, then member). ([#522](https://github.com/diffplug/spotless/issues/522))
17+
### Fixed
18+
* When P2 download fails, indicate the responsible formatter. ([#1698](https://github.com/diffplug/spotless/issues/1698))
19+
* Fixed a regression which changed the import sorting order in `googleJavaFormat` introduced in `2.38.0`. ([#1680](https://github.com/diffplug/spotless/pull/1680))
20+
### Changes
21+
* Bump default sortpom version to latest `3.0.0` -> `3.2.1`. ([#1675](https://github.com/diffplug/spotless/pull/1675))
22+
* Bump default `ktlint` version to latest `0.48.2` -> `0.49.1`.([#1696](https://github.com/diffplug/spotless/issues/1696))
23+
* Dropped support for `ktlint 0.46.x` following our policy of supporting two breaking changes at a time.
1624

1725
## [2.38.0] - 2023-04-06
1826
### Added

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ lib('npm.PrettierFormatterStep') +'{{yes}} | {{yes}}
9999
lib('npm.TsFmtFormatterStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
100100
lib('pom.SortPomStep') +'{{no}} | {{yes}} | {{no}} | {{no}} |',
101101
lib('python.BlackStep') +'{{yes}} | {{no}} | {{no}} | {{no}} |',
102+
lib('rome.RomeStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
102103
lib('scala.ScalaFmtStep') +'{{yes}} | {{yes}} | {{yes}} | {{no}} |',
103104
lib('sql.DBeaverSQLFormatterStep') +'{{yes}} | {{yes}} | {{yes}} | {{no}} |',
104105
extra('wtp.EclipseWtpFormatterStep') +'{{yes}} | {{yes}} | {{no}} | {{no}} |',
@@ -148,6 +149,7 @@ lib('yaml.JacksonYamlStep') +'{{yes}} | {{yes}}
148149
| [`npm.TsFmtFormatterStep`](lib/src/main/java/com/diffplug/spotless/npm/TsFmtFormatterStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
149150
| [`pom.SortPomStep`](lib/src/main/java/com/diffplug/spotless/pom/SortPomStep.java) | :white_large_square: | :+1: | :white_large_square: | :white_large_square: |
150151
| [`python.BlackStep`](lib/src/main/java/com/diffplug/spotless/python/BlackStep.java) | :+1: | :white_large_square: | :white_large_square: | :white_large_square: |
152+
| [`rome.RomeStep`](lib/src/main/java/com/diffplug/spotless/rome/RomeStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |
151153
| [`scala.ScalaFmtStep`](lib/src/main/java/com/diffplug/spotless/scala/ScalaFmtStep.java) | :+1: | :+1: | :+1: | :white_large_square: |
152154
| [`sql.DBeaverSQLFormatterStep`](lib/src/main/java/com/diffplug/spotless/sql/DBeaverSQLFormatterStep.java) | :+1: | :+1: | :+1: | :white_large_square: |
153155
| [`wtp.EclipseWtpFormatterStep`](lib-extra/src/main/java/com/diffplug/spotless/extra/wtp/EclipseWtpFormatterStep.java) | :+1: | :+1: | :white_large_square: | :white_large_square: |

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ VER_SLF4J=[1.6,2.0[
3030
# Used in multiple places
3131
VER_DURIAN=1.2.0
3232
VER_JGIT=6.5.0.202303070854-r
33-
VER_JUNIT=5.9.2
33+
VER_JUNIT=5.9.3
3434
VER_ASSERTJ=3.24.2
3535
VER_MOCKITO=5.3.1

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package com.diffplug.spotless.extra;
1717

1818
import java.io.File;
19+
import java.io.IOException;
1920
import java.io.Serializable;
2021
import java.util.ArrayList;
2122
import java.util.List;
@@ -36,6 +37,7 @@
3637
import dev.equo.solstice.p2.P2ClientCache;
3738
import dev.equo.solstice.p2.P2Model;
3839
import dev.equo.solstice.p2.P2QueryCache;
40+
import dev.equo.solstice.p2.P2QueryResult;
3941

4042
/**
4143
* Generic Eclipse based formatter step {@link State} builder.
@@ -100,7 +102,12 @@ protected void addPlatformRepo(P2Model model, String version) {
100102

101103
/** Creates the state of the configuration. */
102104
EquoBasedStepBuilder.State get() throws Exception {
103-
var query = createModelWithMirrors().query(P2ClientCache.PREFER_OFFLINE, P2QueryCache.ALLOW);
105+
P2QueryResult query;
106+
try {
107+
query = createModelWithMirrors().query(P2ClientCache.PREFER_OFFLINE, P2QueryCache.ALLOW);
108+
} catch (Exception x) {
109+
throw new IOException("Failed to load " + formatterName + ": " + x, x);
110+
}
104111
var classpath = new ArrayList<File>();
105112
var mavenDeps = new ArrayList<String>();
106113
mavenDeps.add("dev.equo.ide:solstice:1.0.3");

lib/build.gradle

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ versionCompatibility {
4444
// we will support no more than 2 breaking changes at a time = 3 incompatible versions
4545
// we will try to drop down to only one version if a stable API can be maintained for a full year
4646
versions = [
47-
'0.46.0',
4847
'0.47.0',
4948
'0.48.0',
49+
'0.49.0',
5050
]
5151
targetSourceSetName = 'ktlint'
5252
}
@@ -96,26 +96,21 @@ dependencies {
9696
}
9797
}
9898
// ktlint
99-
String VER_KTLINT='0.46.1'
100-
ktlintCompileOnly "com.pinterest:ktlint:$VER_KTLINT"
101-
ktlintCompileOnly "com.pinterest.ktlint:ktlint-core:$VER_KTLINT"
102-
ktlintCompileOnly "com.pinterest.ktlint:ktlint-ruleset-experimental:$VER_KTLINT"
103-
ktlintCompileOnly "com.pinterest.ktlint:ktlint-ruleset-standard:$VER_KTLINT"
104-
compatKtLint0Dot46Dot0CompileOnly 'com.pinterest.ktlint:ktlint-core:0.46.0'
105-
compatKtLint0Dot46Dot0CompileOnly 'com.pinterest.ktlint:ktlint-ruleset-experimental:0.46.0'
106-
compatKtLint0Dot46Dot0CompileOnly 'com.pinterest.ktlint:ktlint-ruleset-standard:0.46.0'
10799
compatKtLint0Dot47Dot0CompileOnly 'com.pinterest.ktlint:ktlint-core:0.47.0'
108100
compatKtLint0Dot47Dot0CompileOnly 'com.pinterest.ktlint:ktlint-ruleset-experimental:0.47.0'
109101
compatKtLint0Dot47Dot0CompileOnly 'com.pinterest.ktlint:ktlint-ruleset-standard:0.47.0'
110102
compatKtLint0Dot48Dot0CompileAndTestOnly 'com.pinterest.ktlint:ktlint-core:0.48.0'
111103
compatKtLint0Dot48Dot0CompileAndTestOnly 'com.pinterest.ktlint:ktlint-ruleset-experimental:0.48.0'
112104
compatKtLint0Dot48Dot0CompileAndTestOnly 'com.pinterest.ktlint:ktlint-ruleset-standard:0.48.0'
105+
compatKtLint0Dot49Dot0CompileAndTestOnly 'com.pinterest.ktlint:ktlint-rule-engine:0.49.0'
106+
compatKtLint0Dot49Dot0CompileAndTestOnly 'com.pinterest.ktlint:ktlint-ruleset-standard:0.49.0'
107+
compatKtLint0Dot49Dot0CompileAndTestOnly 'org.slf4j:slf4j-api:2.0.0'
113108
// palantirJavaFormat
114109
palantirJavaFormatCompileOnly 'com.palantir.javaformat:palantir-java-format:1.1.0' // this version needs to stay compilable against Java 8 for CI Job testNpm
115110
// scalafmt
116111
scalafmtCompileOnly "org.scalameta:scalafmt-core_2.13:3.7.3"
117112
// sortPom
118-
sortPomCompileOnly 'com.github.ekryd.sortpom:sortpom-sorter:3.0.0'
113+
sortPomCompileOnly 'com.github.ekryd.sortpom:sortpom-sorter:3.2.1'
119114
sortPomCompileOnly 'org.slf4j:slf4j-api:2.0.0'
120115
}
121116

lib/src/compatKtLint0Dot46Dot0/java/com/diffplug/spotless/glue/ktlint/compat/KtLintCompat0Dot46Dot0Adapter.java

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

0 commit comments

Comments
 (0)