Skip to content

Commit 79e35c1

Browse files
committed
EditorConfig: add documentation
1 parent b18da45 commit 79e35c1

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

plugin-gradle/README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,14 @@ spotless {
354354

355355
### ktlint
356356

357-
[homepage](https://github.com/pinterest/ktlint). [changelog](https://github.com/pinterest/ktlint/releases). Spotless does not ([yet](https://github.com/diffplug/spotless/issues/142)) respect the `.editorconfig` settings ([ktlint docs](https://github.com/pinterest/ktlint#editorconfig)), but you can provide them manually as `editorConfigOverride`.
357+
[homepage](https://github.com/pinterest/ktlint). [changelog](https://github.com/pinterest/ktlint/releases).
358+
359+
Spotless respects the `.editorconfig` settings by providing `editorConfigPath` option.
360+
([ktlint docs](https://github.com/pinterest/ktlint#editorconfig)).
361+
Default value is the `.editorconfig` file located in the top project.
362+
Passing `null` will clear the option.
363+
364+
Additionally, `editorConfigOverride` options will override what's supplied in `.editorconfig` file.
358365
359366
```kotlin
360367
spotless {
@@ -363,6 +370,7 @@ spotless {
363370
ktlint("0.45.2")
364371
.setUseExperimental(true)
365372
.userData(mapOf("android" to "true"))
373+
.editorConfigPath("$projectDir/config/.editorconfig") // sample unusual placement
366374
.editorConfigOverride(mapOf("indent_size" to 2))
367375
}
368376
}

plugin-maven/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,13 @@ Groovy-Eclipse formatting errors/warnings lead per default to a build failure. T
354354

355355
### ktlint
356356

357-
[homepage](https://github.com/pinterest/ktlint). [changelog](https://github.com/pinterest/ktlint/releases). [code](https://github.com/diffplug/spotless/blob/main/plugin-maven/src/main/java/com/diffplug/spotless/maven/kotlin/Ktlint.java). Spotless does not ([yet](https://github.com/diffplug/spotless/issues/142)) respect the `.editorconfig` settings.
357+
[homepage](https://github.com/pinterest/ktlint). [changelog](https://github.com/pinterest/ktlint/releases).
358+
[code](https://github.com/diffplug/spotless/blob/main/plugin-maven/src/main/java/com/diffplug/spotless/maven/kotlin/Ktlint.java).
359+
360+
Spotless respects the `.editorconfig` settings by providing `editorConfigPath` option.
361+
([ktlint docs](https://github.com/pinterest/ktlint#editorconfig)).
362+
363+
Additionally, `editorConfigOverride` options will override what's supplied in `.editorconfig` file.
358364

359365
```xml
360366
<ktlint>

0 commit comments

Comments
 (0)