-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Correct NoEnumTrailingCheck and UnnessaryEnumSemicolonCheck to handle empty enums #9230
Conversation
Regression for NoEnumTrailingCommaCheck: https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/8653_fix_failure_on_empty_enum_2021131932/reports/diff/index.html No diff |
@strkkk , please rebase and update PR title and description to define target of fix |
1f7b2d8
to
04a5bcb
Compare
@romani done |
@@ -123,17 +124,16 @@ | |||
|
|||
@Override | |||
public int[] getRequiredTokens() { | |||
return new int[] {TokenTypes.ENUM_CONSTANT_DEF}; | |||
return new int[] {TokenTypes.ENUM_DEF}; |
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.
it is not breaking compatibility, such token is not adjustable by user so users are not affected
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.
items:
.../puppycrawl/tools/checkstyle/checks/coding/noenumtrailingcomma/InputNoEnumTrailingComma.java
Outdated
Show resolved
Hide resolved
04a5bcb
to
15af175
Compare
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.
Ok to merge
Fixes for #8653
NoEnumTrailingCheck is rewritten to handle empty enums with only comma as well (there was no violation before since it inspected ENUM_CONSTANT_DEF token instead of ENUM_DEF).
UnnessaryEnumSemicolonCheck test inputs were extended with enum with only comma.