diff --git a/CHANGES.md b/CHANGES.md index dc0bd38c60..f6671d2191 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -12,6 +12,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format ( ## [Unreleased] ### Fixed * Don't treat `@Value` as a type annotation [#1367](https://github.com/diffplug/spotless/pull/1367) +* Support `ktlint_disabled_rules` in `ktlint` 0.47.x [#1378](https://github.com/diffplug/spotless/pull/1378) ## [2.30.0] - 2022-09-14 ### Added diff --git a/lib/src/compatKtLint0Dot47Dot0/java/com/diffplug/spotless/glue/ktlint/compat/KtLintCompat0Dot47Dot0Adapter.java b/lib/src/compatKtLint0Dot47Dot0/java/com/diffplug/spotless/glue/ktlint/compat/KtLintCompat0Dot47Dot0Adapter.java index 842294a5cc..757ffc922b 100644 --- a/lib/src/compatKtLint0Dot47Dot0/java/com/diffplug/spotless/glue/ktlint/compat/KtLintCompat0Dot47Dot0Adapter.java +++ b/lib/src/compatKtLint0Dot47Dot0/java/com/diffplug/spotless/glue/ktlint/compat/KtLintCompat0Dot47Dot0Adapter.java @@ -17,6 +17,7 @@ import static java.util.Collections.emptySet; +import java.util.ArrayList; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; @@ -100,9 +101,13 @@ private static EditorConfigOverride createEditorConfigOverride(final List .filter(rule -> rule instanceof UsesEditorConfigProperties) .flatMap(rule -> ((UsesEditorConfigProperties) rule).getEditorConfigProperties().stream()); + // get complete list of supported properties in DefaultEditorConfigProperties.INSTANCE + List> editorConfigProperties = new ArrayList<>(DefaultEditorConfigProperties.INSTANCE.getEditorConfigProperties()); + editorConfigProperties.add(DefaultEditorConfigProperties.INSTANCE.getKtlintDisabledRulesProperty()); + // Create a mapping of properties to their names based on rule properties and default properties Map> supportedProperties = Stream - .concat(ruleProperties, DefaultEditorConfigProperties.INSTANCE.getEditorConfigProperties().stream()) + .concat(ruleProperties, editorConfigProperties.stream()) .distinct() .collect(Collectors.toMap(property -> property.getType().getName(), property -> property)); diff --git a/plugin-gradle/CHANGES.md b/plugin-gradle/CHANGES.md index a8adac938d..5acd85ddc8 100644 --- a/plugin-gradle/CHANGES.md +++ b/plugin-gradle/CHANGES.md @@ -5,6 +5,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format ( ## [Unreleased] ### Fixed * Don't treat `@Value` as a type annotation [#1367](https://github.com/diffplug/spotless/pull/1367) +* Support `ktlint_disabled_rules` in `ktlint` 0.47.x [#1378](https://github.com/diffplug/spotless/pull/1378) ## [6.11.0] - 2022-09-14 ### Added diff --git a/plugin-maven/CHANGES.md b/plugin-maven/CHANGES.md index 75659026d4..b08a2366fd 100644 --- a/plugin-maven/CHANGES.md +++ b/plugin-maven/CHANGES.md @@ -5,6 +5,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format ( ## [Unreleased] ### Fixed * Don't treat `@Value` as a type annotation [#1367](https://github.com/diffplug/spotless/pull/1367) +* Support `ktlint_disabled_rules` in `ktlint` 0.47.x [#1378](https://github.com/diffplug/spotless/pull/1378) ## [2.27.2] - 2022-10-10 ### Fixed