Thanks. Ok, I now have `ktlint_standard_no-blank-l...
# ktlint
x
Thanks. Ok, I now have
ktlint_standard_no-blank-line-in-list = disabled
in
.editorconfig
, but ktlint is still complaining "Unexpected blank line(s) in value argument list".
Copy code
$ cat .editorconfig 
ktlint_standard_no-blank-line-in-list = disabled

$ cat Foo.kt
val myMap =
    mapOf(
        // a comment about "foo"
        "foo" to computeFoo(),

        // a comment about "bar" and "baz"
        "bar" to computeBar(),
        "baz" to computeBaz(),
    )

$ ktlint Foo.kt 
/tmp/foo/Foo.kt:5:1: Unexpected blank line(s) in value argument list (standard:no-blank-line-in-list)
13:03:54.444 [main] WARN com.pinterest.ktlint.cli.internal.KtlintCommandLine - Lint has found errors than can be autocorrected using 'ktlint --format'

Summary error count (descending) by rule:
  standard:no-blank-line-in-list: 1
Copy code
$ ktlint -V
1.0.1
p
Your
.editorconfig
is not valid. Try:
Copy code
root = true

[*.{kt,kts}]
ktlint_standard_no-blank-line-in-list = disabled
x
Thank you!
b
What’s the purpose of
root = true
?
p
It will stop traversal to the parent directory when trying to locate the
.editorconfig
file. Without this flag, ktlint might pick-up an
.editorconfig
which is located in a parent directory outside your project. Also, with deep hierarchies it does not need to search all parent up to the root.
👍 1