diff --git a/CHANGES.md b/CHANGES.md index efbf1e5ae0..363dac1758 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -26,6 +26,8 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format ( * From now on, we will support no more than 2 breaking changes at a time. * NpmFormatterStepStateBase delays `npm install` call until the formatter is first used. This enables better integration with `gradle-node-plugin`. ([#1522](https://github.com/diffplug/spotless/pull/1522)) +* Bump default `ktlint` version to latest `0.48.1` -> `0.48.2` ([#1529](https://github.com/diffplug/spotless/pull/1529)) +* Bump default `scalafmt` version to latest `3.6.1` -> `3.7.1` ([#1529](https://github.com/diffplug/spotless/pull/1529)) ## [2.32.0] - 2023-01-13 ### Added diff --git a/lib/src/main/java/com/diffplug/spotless/kotlin/KtLintStep.java b/lib/src/main/java/com/diffplug/spotless/kotlin/KtLintStep.java index 7bcae36fb0..0d75460902 100644 --- a/lib/src/main/java/com/diffplug/spotless/kotlin/KtLintStep.java +++ b/lib/src/main/java/com/diffplug/spotless/kotlin/KtLintStep.java @@ -36,11 +36,9 @@ public class KtLintStep { // prevent direct instantiation private KtLintStep() {} - private static final String DEFAULT_VERSION = "0.48.1"; + private static final String DEFAULT_VERSION = "0.48.2"; static final String NAME = "ktlint"; - static final String PACKAGE_PRE_0_32 = "com.github.shyiko"; static final String PACKAGE = "com.pinterest"; - static final String MAVEN_COORDINATE_PRE_0_32 = PACKAGE_PRE_0_32 + ":ktlint:"; static final String MAVEN_COORDINATE = PACKAGE + ":ktlint:"; public static FormatterStep create(Provisioner provisioner) { @@ -114,21 +112,14 @@ static final class State implements Serializable { @Nullable FileSignature editorConfigPath, Map userData, Map editorConfigOverride) throws IOException { - this.version = version; - - String coordinate; - if (BadSemver.version(version) < BadSemver.version(0, 32)) { - coordinate = MAVEN_COORDINATE_PRE_0_32; - } else { - coordinate = MAVEN_COORDINATE; - } - if (BadSemver.version(version) < BadSemver.version(0, 31, 0)) { - throw new IllegalStateException("KtLint versions < 0.31.0 not supported!"); + if (BadSemver.version(version) < BadSemver.version(0, 46, 0)) { + throw new IllegalStateException("KtLint versions < 0.46.0 not supported!"); } + this.version = version; this.useExperimental = useExperimental; this.userData = new TreeMap<>(userData); this.editorConfigOverride = new TreeMap<>(editorConfigOverride); - this.jarState = JarState.from(coordinate + version, provisioner); + this.jarState = JarState.from(MAVEN_COORDINATE + version, provisioner); this.editorConfigPath = editorConfigPath; this.isScript = isScript; } diff --git a/lib/src/main/java/com/diffplug/spotless/scala/ScalaFmtStep.java b/lib/src/main/java/com/diffplug/spotless/scala/ScalaFmtStep.java index bff0d9b215..264ca679db 100644 --- a/lib/src/main/java/com/diffplug/spotless/scala/ScalaFmtStep.java +++ b/lib/src/main/java/com/diffplug/spotless/scala/ScalaFmtStep.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2022 DiffPlug + * Copyright 2016-2023 DiffPlug * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ public class ScalaFmtStep { // prevent direct instantiation private ScalaFmtStep() {} - private static final String DEFAULT_VERSION = "3.6.1"; + static final String DEFAULT_VERSION = "3.7.1"; private static final String DEFAULT_SCALA_MAJOR_VERSION = "2.13"; static final String NAME = "scalafmt"; diff --git a/plugin-gradle/CHANGES.md b/plugin-gradle/CHANGES.md index 693712cbff..8d01068383 100644 --- a/plugin-gradle/CHANGES.md +++ b/plugin-gradle/CHANGES.md @@ -20,6 +20,8 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format ( * `npm`-based formatters `ESLint`, `prettier` and `tsfmt` delay their `npm install` call until the formatters are first used. For gradle this effectively moves the `npm install` call out of the configuration phase and as such enables better integration with `gradle-node-plugin`. ([#1522](https://github.com/diffplug/spotless/pull/1522)) +* Bump default `ktlint` version to latest `0.48.1` -> `0.48.2` ([#1529](https://github.com/diffplug/spotless/pull/1529)) +* Bump default `scalafmt` version to latest `3.6.1` -> `3.7.1` ([#1529](https://github.com/diffplug/spotless/pull/1529)) ## [6.13.0] - 2023-01-14 ### Added diff --git a/plugin-maven/CHANGES.md b/plugin-maven/CHANGES.md index 9cda0d2785..3967f468fd 100644 --- a/plugin-maven/CHANGES.md +++ b/plugin-maven/CHANGES.md @@ -21,6 +21,8 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format ( * `KtLint` does not maintain a stable API - before this PR, we supported every breaking change in the API since 2019. * From now on, we will support no more than 2 breaking changes at a time. * `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) +* Bump default `ktlint` version to latest `0.48.1` -> `0.48.2` ([#1529](https://github.com/diffplug/spotless/pull/1529)) +* Bump default `scalafmt` version to latest `3.6.1` -> `3.7.1` ([#1529](https://github.com/diffplug/spotless/pull/1529)) ## [2.30.0] - 2023-01-13 ### Added diff --git a/testlib/src/main/resources/scala/scalafmt/scalafmt.conf b/testlib/src/main/resources/scala/scalafmt/scalafmt.conf index e15d7318fa..f3cfb3a031 100644 --- a/testlib/src/main/resources/scala/scalafmt/scalafmt.conf +++ b/testlib/src/main/resources/scala/scalafmt/scalafmt.conf @@ -1,4 +1,4 @@ -version = 3.6.1 +version = 3.7.1 runner.dialect = scala213 style = defaultWithAlign # For pretty alignment. maxColumn = 20 # For my teensy narrow display diff --git a/testlib/src/test/java/com/diffplug/spotless/scala/ScalaFmtStepTest.java b/testlib/src/test/java/com/diffplug/spotless/scala/ScalaFmtStepTest.java index 1714dd9e29..c28046e148 100644 --- a/testlib/src/test/java/com/diffplug/spotless/scala/ScalaFmtStepTest.java +++ b/testlib/src/test/java/com/diffplug/spotless/scala/ScalaFmtStepTest.java @@ -30,13 +30,13 @@ class ScalaFmtStepTest extends ResourceHarness { @Test void behaviorDefaultConfig() { - StepHarness.forStep(ScalaFmtStep.create("3.0.0", TestProvisioner.mavenCentral(), null)) + StepHarness.forStep(ScalaFmtStep.create(TestProvisioner.mavenCentral())) .testResource("scala/scalafmt/basic.dirty", "scala/scalafmt/basic.clean_3.0.0"); } @Test void behaviorCustomConfig() { - StepHarness.forStep(ScalaFmtStep.create("3.0.0", TestProvisioner.mavenCentral(), createTestFile("scala/scalafmt/scalafmt.conf"))) + StepHarness.forStep(ScalaFmtStep.create(ScalaFmtStep.DEFAULT_VERSION, TestProvisioner.mavenCentral(), createTestFile("scala/scalafmt/scalafmt.conf"))) .testResource("scala/scalafmt/basic.dirty", "scala/scalafmt/basic.cleanWithCustomConf_3.0.0"); }