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
When destructured parameters in a lambda are put on separate lines with trailing commas turned on, the error Missing newline after "," (wrapping) is issued just after the final trailing comma of the destructuring parenthesis, regardless of how many newlines are actually written.
Expected Behavior
False positive; expected no error.
Observed Behavior
The error Missing newline after "," (wrapping) is issued after the trailing comma of the destructuring parenthesis, regardless of how many newlines are written.
Steps to Reproduce
Enable trailing commas
Write a lambda with destructured parmeters
Put all destructured parameters on separate lines and format the file accordingly
Run ktlint
See error
Demo.kt:
funfoo(block: (Pair<Int, Int>) ->Unit) {}
funmain() {
foo {
(
a,
b,
), // error appears here, regardless of how many newlines are written->
}
}
ktlint output:
Demo.kt:8:15: Missing newline after "," (wrapping)
Your Environment
Version of ktlint used: 0.46.1
Relevant parts of the .editorconfig settings:
ij_kotlin_allow_trailing_comma = true
Operating System and version: Linux Fedora 36
The text was updated successfully, but these errors were encountered:
When destructured parameters in a lambda are put on separate lines with trailing commas turned on, the error
Missing newline after "," (wrapping)
is issued just after the final trailing comma of the destructuring parenthesis, regardless of how many newlines are actually written.Expected Behavior
False positive; expected no error.
Observed Behavior
The error
Missing newline after "," (wrapping)
is issued after the trailing comma of the destructuring parenthesis, regardless of how many newlines are written.Steps to Reproduce
ktlint
Demo.kt
:ktlint
output:Your Environment
Version of ktlint used:
0.46.1
Relevant parts of the
.editorconfig
settings:Operating System and version: Linux Fedora 36
The text was updated successfully, but these errors were encountered: