You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and assume that the function-signature rule is enabled and the (first line of the) function body expression has to be merged with the function signature.
17:41:39.417 [main] INFO com.pinterest.ktlint.cli.internal.KtlintCommandLine - Enable default patterns [**/*.kt, **/*.kts]
x.kts:6:97: Unnecessary trailing comma before ")" (standard:trailing-comma-on-call-site)
src/main/kotlin/Foo.kt:1:53: First line of body expression fits on same line as function signature (standard:function-signature)
src/main/kotlin/Foo.kt:3:1: Exceeded max line length (100) (standard:max-line-length)
src/main/kotlin/Foo.kt:3:31: Missing newline after "{" (standard:wrapping)
src/main/kotlin/Foo.kt:3:46: Expected newline (standard:annotation)
src/main/kotlin/Foo.kt:3:64: Argument should be on a separate line (unless all arguments can fit a single line) (standard:argument-list-wrapping)
src/main/kotlin/Foo.kt:3:102: Argument should be on a separate line (unless all arguments can fit a single line) (standard:argument-list-wrapping)
src/main/kotlin/Foo.kt:3:107: Missing newline before ")" (standard:argument-list-wrapping)
Summary error count (descending) by rule:
standard:argument-list-wrapping: 3
standard:annotation: 1
standard:function-signature: 1
standard:max-line-length: 1
standard:trailing-comma-on-call-site: 1
standard:wrapping: 1
When running format the output changes to:
17:44:18.369 [main] INFO com.pinterest.ktlint.cli.internal.KtlintCommandLine - Enable default patterns [**/*.kt, **/*.kts]
src/main/kotlin/Foo.kt:1:53: Expected newline before annotation (standard:annotation)
Summary error count (descending) by rule:
standard:annotation: 1
This log message is rather confusing when you compare it with the original code sample. However, it should not be compared with the original but with the modified code to make sense.
and the file is formatted as:
Given code below:
and assume that the
function-signature
rule is enabled and the (first line of the) function body expression has to be merged with the function signature.For example with
.editorconfig
:the command
ktlint --relative
results inWhen running
format
the output changes to:This log message is rather confusing when you compare it with the original code sample. However, it should not be compared with the original but with the modified code to make sense.
and the file is formatted as:
The
function-signature
should not format in such a way that if violates theannotation
rule.Originally posted by @paul-dingemans in #2028 (comment)
The text was updated successfully, but these errors were encountered: