Skip to content
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

TrailingCommas rule #3930

Closed
d-aleksandrov opened this issue Jul 2, 2021 · 2 comments
Closed

TrailingCommas rule #3930

d-aleksandrov opened this issue Jul 2, 2021 · 2 comments
Labels

Comments

@d-aleksandrov
Copy link

Mark last function parameter as warning if comma is losed
Bad

class Params(
    val one: Int,
    val two: Int
)

class Params(val one: Int, val two: Int)

Good

class Params(
    val one: Int,
    val two: Int,
)

class Params(val one: Int, val two: Int)

Kotlin Convention page
https://kotlinlang.org/docs/coding-conventions.html#trailing-commas

@cortinico
Copy link
Member

Closing as this is a duplicate of #2398

We believe this is a better fit for ktlint: pinterest/ktlint#709
If there is no progress on KtLint side we might consider offering a first party rule (feel free to propose a PR or Draft) 👍

@cortinico
Copy link
Member

Just a small heads up that it seems like this is coming to KtLint, hence will be available through detekt-formatting soon: pinterest/ktlint#709 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants