Skip to content

Commit 32d2559

Browse files
committed
1 parent d346ef8 commit 32d2559

File tree

9 files changed

+22
-16
lines changed

9 files changed

+22
-16
lines changed

Diff for: CHANGES.md

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ 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+
### Changes
14+
* Bump default `ktlint` version to latest `1.0.0` -> `1.0.1`. ([#1808](https://github.com/diffplug/spotless/pull/1855))
1315

1416
## [2.42.0] - 2023-09-28
1517
### Added

Diff for: lib/build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ versionCompatibility {
4848
'0.48.0',
4949
'0.49.0',
5050
'0.50.0',
51-
'1.0.0',
51+
'1.0.1',
5252
]
5353
targetSourceSetName = 'ktlint'
5454
}
@@ -110,9 +110,9 @@ dependencies {
110110
compatKtLint0Dot50Dot0CompileAndTestOnly 'com.pinterest.ktlint:ktlint-ruleset-standard:0.50.0'
111111
compatKtLint0Dot50Dot0CompileAndTestOnly 'org.slf4j:slf4j-api:2.0.0'
112112
// 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'
113+
compatKtLint1Dot0Dot1CompileAndTestOnly 'com.pinterest.ktlint:ktlint-rule-engine:1.0.1'
114+
compatKtLint1Dot0Dot1CompileAndTestOnly 'com.pinterest.ktlint:ktlint-ruleset-standard:1.0.1'
115+
compatKtLint1Dot0Dot1CompileAndTestOnly 'org.slf4j:slf4j-api:2.0.0'
116116
// palantirJavaFormat
117117
palantirJavaFormatCompileOnly 'com.palantir.javaformat:palantir-java-format:1.1.0' // this version needs to stay compilable against Java 8 for CI Job testNpm
118118
// scalafmt

Diff for: lib/src/compatKtLint1Dot0Dot0/java/com/diffplug/spotless/glue/ktlint/compat/KtLintCompat1Dot0Dot0Adapter.java renamed to lib/src/compatKtLint1Dot0Dot1/java/com/diffplug/spotless/glue/ktlint/compat/KtLintCompat1Dot0Dot1Adapter.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@
5353
import kotlin.Unit;
5454
import kotlin.jvm.functions.Function2;
5555

56-
public class KtLintCompat1Dot0Dot0Adapter implements KtLintCompatAdapter {
56+
public class KtLintCompat1Dot0Dot1Adapter implements KtLintCompatAdapter {
5757

58-
private static final Logger logger = LoggerFactory.getLogger(KtLintCompat1Dot0Dot0Adapter.class);
58+
private static final Logger logger = LoggerFactory.getLogger(KtLintCompat1Dot0Dot1Adapter.class);
5959

6060
private static final List<EditorConfigProperty<?>> DEFAULT_EDITOR_CONFIG_PROPERTIES;
6161

Diff for: lib/src/ktlint/java/com/diffplug/spotless/glue/ktlint/KtlintFormatterFunc.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public KtlintFormatterFunc(String version, boolean isScript, FileSignature edito
3737
int majorVersion = Integer.parseInt(versions[0]);
3838
int minorVersion = Integer.parseInt(versions[1]);
3939
if (majorVersion == 1) {
40-
this.adapter = new KtLintCompat1Dot0Dot0Adapter();
40+
this.adapter = new KtLintCompat1Dot0Dot1Adapter();
4141
} else {
4242
if (minorVersion >= 50) {
4343
// Fixed `RuleId` and `RuleSetId` issues

Diff for: lib/src/main/java/com/diffplug/spotless/kotlin/KtLintStep.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class KtLintStep {
3636
// prevent direct instantiation
3737
private KtLintStep() {}
3838

39-
private static final String DEFAULT_VERSION = "1.0.0";
39+
private static final String DEFAULT_VERSION = "1.0.1";
4040
static final String NAME = "ktlint";
4141
static final String MAVEN_COORDINATE_0_DOT = "com.pinterest:ktlint:";
4242
static final String MAVEN_COORDINATE_1_DOT = "com.pinterest.ktlint:ktlint-cli:";

Diff for: lib/src/testCompatKtLint1Dot0Dot0/java/com/diffplug/spotless/glue/ktlint/compat/KtLintCompat1Dot0Dot0AdapterTest.java renamed to lib/src/testCompatKtLint1Dot0Dot0/java/com/diffplug/spotless/glue/ktlint/compat/KtLintCompat1Dot0Dot1AdapterTest.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,24 @@
2929
import org.junit.jupiter.api.Test;
3030
import org.junit.jupiter.api.io.TempDir;
3131

32-
public class KtLintCompat1Dot0Dot0AdapterTest {
32+
public class KtLintCompat1Dot0Dot1AdapterTest {
3333
@Test
3434
public void testDefaults(@TempDir Path path) throws IOException {
35-
KtLintCompat1Dot0Dot0Adapter KtLintCompat1Dot0Dot0Adapter = new KtLintCompat1Dot0Dot0Adapter();
35+
KtLintCompat1Dot0Dot1Adapter KtLintCompat1Dot0Dot1Adapter = new KtLintCompat1Dot0Dot1Adapter();
3636
String text = loadAndWriteText(path, "EmptyClassBody.kt");
3737
final Path filePath = Paths.get(path.toString(), "EmptyClassBody.kt");
3838

3939
Map<String, String> userData = new HashMap<>();
4040

4141
Map<String, Object> editorConfigOverrideMap = new HashMap<>();
4242

43-
String formatted = KtLintCompat1Dot0Dot0Adapter.format(text, filePath, false, null, userData, editorConfigOverrideMap);
43+
String formatted = KtLintCompat1Dot0Dot1Adapter.format(text, filePath, false, null, userData, editorConfigOverrideMap);
4444
assertEquals("class EmptyClassBody\n", formatted);
4545
}
4646

4747
@Test
4848
public void testEditorConfigCanDisable(@TempDir Path path) throws IOException {
49-
KtLintCompat1Dot0Dot0Adapter KtLintCompat1Dot0Dot0Adapter = new KtLintCompat1Dot0Dot0Adapter();
49+
KtLintCompat1Dot0Dot1Adapter KtLintCompat1Dot0Dot1Adapter = new KtLintCompat1Dot0Dot1Adapter();
5050
String text = loadAndWriteText(path, "FailsNoSemicolons.kt");
5151
final Path filePath = Paths.get(path.toString(), "FailsNoSemicolons.kt");
5252

@@ -56,12 +56,12 @@ public void testEditorConfigCanDisable(@TempDir Path path) throws IOException {
5656
editorConfigOverrideMap.put("indent_style", "tab");
5757
editorConfigOverrideMap.put("ktlint_standard_no-semi", "disabled");
5858

59-
String formatted = KtLintCompat1Dot0Dot0Adapter.format(text, filePath, false, null, userData, editorConfigOverrideMap);
59+
String formatted = KtLintCompat1Dot0Dot1Adapter.format(text, filePath, false, null, userData, editorConfigOverrideMap);
6060
assertEquals("class FailsNoSemicolons {\n\tval i = 0;\n}\n", formatted);
6161
}
6262

6363
private static String loadAndWriteText(Path path, String name) throws IOException {
64-
try (InputStream is = KtLintCompat1Dot0Dot0AdapterTest.class.getResourceAsStream("/" + name)) {
64+
try (InputStream is = KtLintCompat1Dot0Dot1AdapterTest.class.getResourceAsStream("/" + name)) {
6565
Files.copy(is, path.resolve(name));
6666
}
6767
return new String(Files.readAllBytes(path.resolve(name)), StandardCharsets.UTF_8);

Diff for: plugin-gradle/CHANGES.md

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `3.27.0`).
44

55
## [Unreleased]
6+
### Changes
7+
* Bump default `ktlint` version to latest `1.0.0` -> `1.0.1`. ([#1808](https://github.com/diffplug/spotless/pull/1855))
68

79
## [6.22.0] - 2023-09-28
810
### Added

Diff for: plugin-maven/CHANGES.md

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `1.27.0`).
44

55
## [Unreleased]
6+
### Changes
7+
* Bump default `ktlint` version to latest `1.0.0` -> `1.0.1`. ([#1808](https://github.com/diffplug/spotless/pull/1855))
68

79
### Added
810
* CompileSourceRoots and TestCompileSourceRoots are now respected as default includes. These properties are commonly set when adding extra source directories. ([#1846](https://github.com/diffplug/spotless/issues/1846))

Diff for: testlib/src/test/java/com/diffplug/spotless/kotlin/KtLintStepTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ void works0_50_0() {
7575
}
7676

7777
@Test
78-
void works1_0_0() {
79-
FormatterStep step = KtLintStep.create("1.0.0", TestProvisioner.mavenCentral());
78+
void works1_0_1() {
79+
FormatterStep step = KtLintStep.create("1.0.1", TestProvisioner.mavenCentral());
8080
StepHarnessWithFile.forStep(this, step)
8181
.testResource("kotlin/ktlint/basic.dirty", "kotlin/ktlint/basic.clean")
8282
.testResourceExceptionMsg("kotlin/ktlint/unsolvable.dirty").isEqualTo("Error on line: 1, column: 1\n" +

0 commit comments

Comments
 (0)