-
Notifications
You must be signed in to change notification settings - Fork 510
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
Formatting enum class with member definition and missing trailing commas causes rule violations on first run #1786
Comments
I have the same issue |
See release notes of 0.48.0:
|
@paul-dingemans I don't quite follow. My issue is that after doing formatting, ktlint reports invalid |
Ah now I see. Although it is not visual in the textual representation of the code, the trailing comma is not inserted at the correct place in the AST representation of the code. I will try to fix it. |
…a to an enum class containing a code element after the last enum entry Closes #1786
…a to an enum class containing a code element after the last enum entry Closes #1786
Expected Behavior
When formatting and validating the following enum class, the ktlint command should exit successfully (status
0
):Observed Behavior
When running ktlint on the above enum class, it is formatted correctly, but the run fails with rule violations (exit status
1
):I note that the line number for the
no-semi
violation is the line number after formatting.A second run on the (now properly formatted) code runs correctly (exit status
0
):Steps to Reproduce
Run command on above enum class:
ktlint --format
Your Environment
The text was updated successfully, but these errors were encountered: