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

Semi-Rule isn't working with ij_kotlin_allow_trailing_comma_on_call_site = true #1818

Closed
rbubke opened this issue Feb 13, 2023 · 3 comments
Closed

Comments

@rbubke
Copy link

rbubke commented Feb 13, 2023

When having ij_kotlin_allow_trailing_comma_on_call_site rule enabled the semi-rule isn't working anymore for enum classes.

`internal enum class Type {
A,
B;

val x = true
}`

ktlintFormat corrects this to a wrong state:

`internal enum class Type {
A,
B,
;

val x = true
}`

Which produces further errors:

  • Missing trailing comma before "}" (trailing-comma-on-declaration-site)
  • Unnecessary semicolon (no-semi)
@paul-dingemans
Copy link
Collaborator

Duplicate of #1733

@paul-dingemans paul-dingemans marked this as a duplicate of #1733 Feb 13, 2023
@paul-dingemans paul-dingemans closed this as not planned Won't fix, can't repro, duplicate, stale Feb 13, 2023
@rbubke
Copy link
Author

rbubke commented Feb 14, 2023

Duplicate of #1733

I think this isn't a duplicate but a new bug in the trailing-comma rule. The comma shouldn't be added if there a semi colon already exists.

@paul-dingemans
Copy link
Collaborator

Please read all comments of #1733 in which the reasoning is explained why it is not a bug.

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

No branches or pull requests

2 participants