Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

--stdin no longer respects .editorconfig #1651

Closed
benkay opened this issue Sep 20, 2022 · 1 comment · Fixed by #1655
Closed

--stdin no longer respects .editorconfig #1651

benkay opened this issue Sep 20, 2022 · 1 comment · Fixed by #1655
Labels
bug cli ktlint command line interface
Milestone

Comments

@benkay
Copy link

benkay commented Sep 20, 2022

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)
paul-dingemans added a commit to paul-dingemans/ktlint that referenced this issue Sep 21, 2022
@paul-dingemans paul-dingemans added this to the 0.48.0 milestone Sep 21, 2022
@paul-dingemans
Copy link
Collaborator

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

@paul-dingemans paul-dingemans added bug cli ktlint command line interface labels Sep 22, 2022
paul-dingemans added a commit that referenced this issue Sep 26, 2022
* Read properties from editorconfig when running CLI with options "--stdin --editorconfig=/path/to/editorconfig"

Closes #1651
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug cli ktlint command line interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants