-
Notifications
You must be signed in to change notification settings - Fork 506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trailing comment is reported as wrong indentation #710
Comments
@lwasyl hm, could you post the full example? I don't think it's a valid Kotlin code, or is it new trailing comma? |
Yeah, sorry, I must've copied it wrong. Overall this issue happened when I had a comment in the same line as a parameter, and there were more parameters below. It's not related to the new trailing comma feature |
Weird, I've tried to reproduce it, but this is passing just fine, I guess you had something more sophisticated :)
|
That's right, I checked and here's the offending code: fun foo(param: Foo, other: String) {
foo(
param = param
.copy(foo = ""), // A comment
other = ""
)
}
data class Foo(val foo: String, val bar: Int) Fails on line with |
Ktlint 0.36.0
For the following code:
KtLint complains with
[experimental:indent] Missing newline after ","
and reformats this code toThis is not right, sice it's a comment and it pertains to that specific line. It also fits within the column limit.
The text was updated successfully, but these errors were encountered: