ktlint icon indicating copy to clipboard operation
ktlint copied to clipboard

--stdin no longer respects .editorconfig

Open benkay opened this issue 3 years ago • 1 comments

0.47(.1) seems to have broken .editorconfig support when using --stdin

class Foo {
fun foo() {}
}
[*.kt]
indent_size = 2

With 0.47.1, the .editorconfig file is not honored. It doesn't matter whether it's specified explicitly or not

> cat code.kt | ktlint-0.47.1 --stdin --editorconfig=.editorconfig
8:54:57.762 [main] INFO com.pinterest.ktlint.internal.KtlintCommandLine - Enable default patterns [**/*.kt, **/*.kts]
<stdin>:2:1: Unexpected indentation (0) (should be 4) (indent)

0.46.1 Works as expected:

> cat code.kt | ktlint-0.46.1 --stdin --editorconfig=.editorconfig
<stdin>:2:1: Unexpected indentation (0) (should be 2) (indent)

benkay avatar Sep 20 '22 18:09 benkay

You're right. This has gone wrong in 0.47.x.

paul-dingemans avatar Sep 21 '22 20:09 paul-dingemans