Skip to content

Commit 707e50e

Browse files
bcmedeirosBruno Medeiros
authored andcommitted
fix(ktlint): support ktlint_disabled_rules in 0.47+
1 parent b417bcd commit 707e50e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/src/compatKtLint0Dot47Dot0/java/com/diffplug/spotless/glue/ktlint/compat/KtLintCompat0Dot47Dot0Adapter.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,13 @@ private static EditorConfigOverride createEditorConfigOverride(final List<Rule>
100100
.filter(rule -> rule instanceof UsesEditorConfigProperties)
101101
.flatMap(rule -> ((UsesEditorConfigProperties) rule).getEditorConfigProperties().stream());
102102

103+
// get complete list of supported properties in DefaultEditorConfigProperties.INSTANCE
104+
List<UsesEditorConfigProperties.EditorConfigProperty<?>> editorConfigProperties = DefaultEditorConfigProperties.INSTANCE.getEditorConfigProperties();
105+
editorConfigProperties.add(DefaultEditorConfigProperties.INSTANCE.getKtlintDisabledRulesProperty());
106+
103107
// Create a mapping of properties to their names based on rule properties and default properties
104108
Map<String, UsesEditorConfigProperties.EditorConfigProperty<?>> supportedProperties = Stream
105-
.concat(ruleProperties, DefaultEditorConfigProperties.INSTANCE.getEditorConfigProperties().stream())
109+
.concat(ruleProperties, editorConfigProperties.stream())
106110
.distinct()
107111
.collect(Collectors.toMap(property -> property.getType().getName(), property -> property));
108112

0 commit comments

Comments
 (0)