Skip to content

Commit e3be877

Browse files
authored
Bump default versions to latest available (#1529)
2 parents 6b3ab24 + 5d6714d commit e3be877

File tree

7 files changed

+16
-19
lines changed

7 files changed

+16
-19
lines changed

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
2626
* From now on, we will support no more than 2 breaking changes at a time.
2727
* NpmFormatterStepStateBase delays `npm install` call until the formatter is first used. This enables better integration
2828
with `gradle-node-plugin`. ([#1522](https://github.com/diffplug/spotless/pull/1522))
29+
* Bump default `ktlint` version to latest `0.48.1` -> `0.48.2` ([#1529](https://github.com/diffplug/spotless/pull/1529))
30+
* Bump default `scalafmt` version to latest `3.6.1` -> `3.7.1` ([#1529](https://github.com/diffplug/spotless/pull/1529))
2931

3032
## [2.32.0] - 2023-01-13
3133
### Added

lib/src/main/java/com/diffplug/spotless/kotlin/KtLintStep.java

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,9 @@ public class KtLintStep {
3636
// prevent direct instantiation
3737
private KtLintStep() {}
3838

39-
private static final String DEFAULT_VERSION = "0.48.1";
39+
private static final String DEFAULT_VERSION = "0.48.2";
4040
static final String NAME = "ktlint";
41-
static final String PACKAGE_PRE_0_32 = "com.github.shyiko";
4241
static final String PACKAGE = "com.pinterest";
43-
static final String MAVEN_COORDINATE_PRE_0_32 = PACKAGE_PRE_0_32 + ":ktlint:";
4442
static final String MAVEN_COORDINATE = PACKAGE + ":ktlint:";
4543

4644
public static FormatterStep create(Provisioner provisioner) {
@@ -114,21 +112,14 @@ static final class State implements Serializable {
114112
@Nullable FileSignature editorConfigPath,
115113
Map<String, String> userData,
116114
Map<String, Object> editorConfigOverride) throws IOException {
117-
this.version = version;
118-
119-
String coordinate;
120-
if (BadSemver.version(version) < BadSemver.version(0, 32)) {
121-
coordinate = MAVEN_COORDINATE_PRE_0_32;
122-
} else {
123-
coordinate = MAVEN_COORDINATE;
124-
}
125-
if (BadSemver.version(version) < BadSemver.version(0, 31, 0)) {
126-
throw new IllegalStateException("KtLint versions < 0.31.0 not supported!");
115+
if (BadSemver.version(version) < BadSemver.version(0, 46, 0)) {
116+
throw new IllegalStateException("KtLint versions < 0.46.0 not supported!");
127117
}
118+
this.version = version;
128119
this.useExperimental = useExperimental;
129120
this.userData = new TreeMap<>(userData);
130121
this.editorConfigOverride = new TreeMap<>(editorConfigOverride);
131-
this.jarState = JarState.from(coordinate + version, provisioner);
122+
this.jarState = JarState.from(MAVEN_COORDINATE + version, provisioner);
132123
this.editorConfigPath = editorConfigPath;
133124
this.isScript = isScript;
134125
}

lib/src/main/java/com/diffplug/spotless/scala/ScalaFmtStep.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2022 DiffPlug
2+
* Copyright 2016-2023 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -34,7 +34,7 @@ public class ScalaFmtStep {
3434
// prevent direct instantiation
3535
private ScalaFmtStep() {}
3636

37-
private static final String DEFAULT_VERSION = "3.6.1";
37+
static final String DEFAULT_VERSION = "3.7.1";
3838

3939
private static final String DEFAULT_SCALA_MAJOR_VERSION = "2.13";
4040
static final String NAME = "scalafmt";

plugin-gradle/CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
2020
* `npm`-based formatters `ESLint`, `prettier` and `tsfmt` delay their `npm install` call until the formatters are first
2121
used. For gradle this effectively moves the `npm install` call out of the configuration phase and as such enables
2222
better integration with `gradle-node-plugin`. ([#1522](https://github.com/diffplug/spotless/pull/1522))
23+
* Bump default `ktlint` version to latest `0.48.1` -> `0.48.2` ([#1529](https://github.com/diffplug/spotless/pull/1529))
24+
* Bump default `scalafmt` version to latest `3.6.1` -> `3.7.1` ([#1529](https://github.com/diffplug/spotless/pull/1529))
2325

2426
## [6.13.0] - 2023-01-14
2527
### Added

plugin-maven/CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
2121
* `KtLint` does not maintain a stable API - before this PR, we supported every breaking change in the API since 2019.
2222
* From now on, we will support no more than 2 breaking changes at a time.
2323
* `npm`-based formatters `ESLint`, `prettier` and `tsfmt` delay their `npm install` call until the formatters are first used. ([#1522](https://github.com/diffplug/spotless/pull/1522)
24+
* Bump default `ktlint` version to latest `0.48.1` -> `0.48.2` ([#1529](https://github.com/diffplug/spotless/pull/1529))
25+
* Bump default `scalafmt` version to latest `3.6.1` -> `3.7.1` ([#1529](https://github.com/diffplug/spotless/pull/1529))
2426

2527
## [2.30.0] - 2023-01-13
2628
### Added
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = 3.6.1
1+
version = 3.7.1
22
runner.dialect = scala213
33
style = defaultWithAlign # For pretty alignment.
44
maxColumn = 20 # For my teensy narrow display

testlib/src/test/java/com/diffplug/spotless/scala/ScalaFmtStepTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@
3030
class ScalaFmtStepTest extends ResourceHarness {
3131
@Test
3232
void behaviorDefaultConfig() {
33-
StepHarness.forStep(ScalaFmtStep.create("3.0.0", TestProvisioner.mavenCentral(), null))
33+
StepHarness.forStep(ScalaFmtStep.create(TestProvisioner.mavenCentral()))
3434
.testResource("scala/scalafmt/basic.dirty", "scala/scalafmt/basic.clean_3.0.0");
3535
}
3636

3737
@Test
3838
void behaviorCustomConfig() {
39-
StepHarness.forStep(ScalaFmtStep.create("3.0.0", TestProvisioner.mavenCentral(), createTestFile("scala/scalafmt/scalafmt.conf")))
39+
StepHarness.forStep(ScalaFmtStep.create(ScalaFmtStep.DEFAULT_VERSION, TestProvisioner.mavenCentral(), createTestFile("scala/scalafmt/scalafmt.conf")))
4040
.testResource("scala/scalafmt/basic.dirty", "scala/scalafmt/basic.cleanWithCustomConf_3.0.0");
4141
}
4242

0 commit comments

Comments
 (0)