Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Enum trailing comma formatting is missing indentation #1609

Closed
feser opened this issue Aug 26, 2022 · 0 comments · Fixed by #1633
Closed

Enum trailing comma formatting is missing indentation #1609

feser opened this issue Aug 26, 2022 · 0 comments · Fixed by #1633

Comments

@feser
Copy link

feser commented Aug 26, 2022

Expected Behavior

When an enum missing trailing comma is formatted, indentation is missing for ;.

When following code block is formatted

enum class SomeEnum1(id: String) {
    FOO("foo"),
    BAR("bar");
    
    fun doSomething(id: String) {}
}

Expected output

enum class SomeEnum1(id: String) {
    FOO("foo"),
    BAR("bar"),
    ;

    fun doSomething(id: String) {}
}

Observed output

enum class SomeEnum1(id: String) {
    FOO("foo"),
    BAR("bar"),
;
    
    fun doSomething(id: String) {}
}

Your Environment

  • Version of ktlint used: 0.47.0
@paul-dingemans paul-dingemans added this to the 0.47.1 milestone Aug 27, 2022
paul-dingemans added a commit to paul-dingemans/ktlint that referenced this issue Sep 3, 2022
@paul-dingemans paul-dingemans mentioned this issue Sep 3, 2022
6 tasks
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants