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

Single line enum should not be wrapped #2177

Closed
paul-dingemans opened this issue Aug 12, 2023 · 0 comments · Fixed by #2178
Closed

Single line enum should not be wrapped #2177

paul-dingemans opened this issue Aug 12, 2023 · 0 comments · Fixed by #2178
Assignees
Milestone

Comments

@paul-dingemans
Copy link
Collaborator

Given enum below:

enum class RuleMethod { BEFORE_FIRST, BEFORE_CHILDREN, VISIT, AFTER_CHILDREN, AFTER_LAST }

This enum is formatted by the statement-wrapping rule as follows:

    enum class RuleMethod {
        BEFORE_FIRST,
        BEFORE_CHILDREN,
        VISIT,
        AFTER_CHILDREN,
        AFTER_LAST,
    }

A single line enum should however not be changed by this rule.

Note: this problem can not be reproduced in ktlint CLI version 0.50 due to #2170.

@paul-dingemans paul-dingemans added this to the 1.0 (Yeah!) milestone Aug 12, 2023
@paul-dingemans paul-dingemans self-assigned this Aug 12, 2023
paul-dingemans added a commit that referenced this issue Aug 12, 2023
 Closes #2170

 Align names of Rule classes, file and `RULE_ID` constants

 Closes #2176

 Do not wrap a single line enum class

 Closes #2177
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant