Skip to content

Commit 62edfc5

Browse files
committed
Correctly provide EditorConfig property types for Ktlint
1 parent 9a8a407 commit 62edfc5

File tree

6 files changed

+12
-8
lines changed

6 files changed

+12
-8
lines changed

CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
2020
* **BREAKING** Replace `PipeStepPair` with `FenceStep`. ([#1954](https://github.com/diffplug/spotless/pull/1954))
2121
### Fixed
2222
* Ignore system git config when running tests ([#1990](https://github.com/diffplug/spotless/issues/1990))
23+
* Correctly provide EditorConfig property types for Ktlint ([#20xx](https://github.com/diffplug/spotless/issues/20xx))
2324

2425
## [2.45.0] - 2024-01-23
2526
### Added

lib/src/compatKtLint0Dot49Dot0/java/com/diffplug/spotless/glue/ktlint/compat/KtLintCompat0Dot49Dot0Adapter.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023 DiffPlug
2+
* Copyright 2023-2024 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.
@@ -38,6 +38,7 @@
3838
import com.pinterest.ktlint.rule.engine.api.LintError;
3939
import com.pinterest.ktlint.rule.engine.core.api.Rule;
4040
import com.pinterest.ktlint.rule.engine.core.api.RuleProvider;
41+
import com.pinterest.ktlint.rule.engine.core.api.RuleProviderKt;
4142
import com.pinterest.ktlint.rule.engine.core.api.editorconfig.CodeStyleEditorConfigPropertyKt;
4243
import com.pinterest.ktlint.rule.engine.core.api.editorconfig.EditorConfigProperty;
4344
import com.pinterest.ktlint.rule.engine.core.api.editorconfig.EndOfLinePropertyKt;
@@ -142,7 +143,7 @@ public String format(
142143
if (editorConfigPath == null || !Files.exists(editorConfigPath)) {
143144
editorConfig = EditorConfigDefaults.Companion.getEMPTY_EDITOR_CONFIG_DEFAULTS();
144145
} else {
145-
editorConfig = EditorConfigDefaults.Companion.load(editorConfigPath);
146+
editorConfig = EditorConfigDefaults.Companion.load(editorConfigPath, RuleProviderKt.propertyTypes(allRuleProviders));
146147
}
147148

148149
return new KtLintRuleEngine(

lib/src/compatKtLint0Dot50Dot0/java/com/diffplug/spotless/glue/ktlint/compat/KtLintCompat0Dot50Dot0Adapter.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023 DiffPlug
2+
* Copyright 2023-2024 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.
@@ -17,7 +17,6 @@
1717

1818
import java.nio.file.Files;
1919
import java.nio.file.Path;
20-
import java.util.Collections;
2120
import java.util.List;
2221
import java.util.Map;
2322
import java.util.Objects;
@@ -38,6 +37,7 @@
3837
import com.pinterest.ktlint.rule.engine.core.api.Rule;
3938
import com.pinterest.ktlint.rule.engine.core.api.RuleId;
4039
import com.pinterest.ktlint.rule.engine.core.api.RuleProvider;
40+
import com.pinterest.ktlint.rule.engine.core.api.RuleProviderKt;
4141
import com.pinterest.ktlint.rule.engine.core.api.RuleSetId;
4242
import com.pinterest.ktlint.rule.engine.core.api.editorconfig.CodeStyleEditorConfigPropertyKt;
4343
import com.pinterest.ktlint.rule.engine.core.api.editorconfig.EditorConfigProperty;
@@ -105,7 +105,7 @@ public String format(
105105
if (editorConfigPath == null || !Files.exists(editorConfigPath)) {
106106
editorConfig = EditorConfigDefaults.Companion.getEMPTY_EDITOR_CONFIG_DEFAULTS();
107107
} else {
108-
editorConfig = EditorConfigDefaults.Companion.load(editorConfigPath, Collections.emptySet());
108+
editorConfig = EditorConfigDefaults.Companion.load(editorConfigPath, RuleProviderKt.propertyTypes(allRuleProviders));
109109
}
110110

111111
return new KtLintRuleEngine(

lib/src/compatKtLint1Dot0Dot0/java/com/diffplug/spotless/glue/ktlint/compat/KtLintCompat1Dot0Dot0Adapter.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023 DiffPlug
2+
* Copyright 2023-2024 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.
@@ -17,7 +17,6 @@
1717

1818
import java.nio.file.Files;
1919
import java.nio.file.Path;
20-
import java.util.Collections;
2120
import java.util.List;
2221
import java.util.Map;
2322
import java.util.Objects;
@@ -38,6 +37,7 @@
3837
import com.pinterest.ktlint.rule.engine.core.api.Rule;
3938
import com.pinterest.ktlint.rule.engine.core.api.RuleId;
4039
import com.pinterest.ktlint.rule.engine.core.api.RuleProvider;
40+
import com.pinterest.ktlint.rule.engine.core.api.RuleProviderKt;
4141
import com.pinterest.ktlint.rule.engine.core.api.RuleSetId;
4242
import com.pinterest.ktlint.rule.engine.core.api.editorconfig.CodeStyleEditorConfigPropertyKt;
4343
import com.pinterest.ktlint.rule.engine.core.api.editorconfig.EditorConfigProperty;
@@ -105,7 +105,7 @@ public String format(
105105
if (editorConfigPath == null || !Files.exists(editorConfigPath)) {
106106
editorConfig = EditorConfigDefaults.Companion.getEMPTY_EDITOR_CONFIG_DEFAULTS();
107107
} else {
108-
editorConfig = EditorConfigDefaults.Companion.load(editorConfigPath, Collections.emptySet());
108+
editorConfig = EditorConfigDefaults.Companion.load(editorConfigPath, RuleProviderKt.propertyTypes(allRuleProviders));
109109
}
110110

111111
return new KtLintRuleEngine(

plugin-gradle/CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
55
## [Unreleased]
66
### Fixed
77
* Ignore system git config when running tests ([#1990](https://github.com/diffplug/spotless/issues/1990))
8+
* Correctly provide EditorConfig property types for Ktlint ([#20xx](https://github.com/diffplug/spotless/issues/20xx))
89
### Changes
910
* Bump default `ktfmt` version to latest `0.46` -> `0.47`. ([#2045](https://github.com/diffplug/spotless/pull/2045))
1011
### Added

plugin-maven/CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
55
## [Unreleased]
66
### Fixed
77
* Ignore system git config when running tests ([#1990](https://github.com/diffplug/spotless/issues/1990))
8+
* Correctly provide EditorConfig property types for Ktlint ([#20xx](https://github.com/diffplug/spotless/issues/20xx))
89
### Changes
910
* Bump default `ktfmt` version to latest `0.46` -> `0.47`. ([#2045](https://github.com/diffplug/spotless/pull/2045))
1011
### Added

0 commit comments

Comments
 (0)