-
Notifications
You must be signed in to change notification settings - Fork 503
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
Implement a rule to lint enum entry name #638
Implement a rule to lint enum entry name #638
Conversation
I forgot an important thing. This format might causes compile error because enum entry identifier will be changed. |
I would propose to disable formatting for now. Generally it is interesting question how to handle such cases that makes code non-compilable. Maybe via some additional configuration flag - |
Agree that we should disable formatting if it could cause compile errors. |
@Tapchicoma @shashachu |
b9af042
to
769313c
Compare
769313c
to
2007e53
Compare
2007e53
to
7c5ee78
Compare
e8c1663
to
cf66393
Compare
...erimental/src/main/kotlin/com/pinterest/ktlint/ruleset/experimental/EnumEntryNameCaseRule.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for fixing this 👍
Resolve #635
Implement an experimental rule to lint enum entry name.
This rule enforces enum entry names to
So, "ENTRY_NAME" and "EntryName" are valid, "Entry_Name", "entry_name" and "entryName" are invalid.
Currently auto-format will convert entry name to all upper case, but this behavior is highly debatable.
Before format
formatted