Skip to content

Commit

Permalink
Bump default versions to latest available (#1529)
Browse files Browse the repository at this point in the history
  • Loading branch information
nedtwigg authored Jan 26, 2023
2 parents 6b3ab24 + 5d6714d commit e3be877
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 19 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 5 additions & 14 deletions lib/src/main/java/com/diffplug/spotless/kotlin/KtLintStep.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -114,21 +112,14 @@ static final class State implements Serializable {
@Nullable FileSignature editorConfigPath,
Map<String, String> userData,
Map<String, Object> 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;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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";
Expand Down
2 changes: 2 additions & 0 deletions plugin-gradle/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions plugin-maven/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion testlib/src/main/resources/scala/scalafmt/scalafmt.conf
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

Expand Down

0 comments on commit e3be877

Please sign in to comment.