-
Notifications
You must be signed in to change notification settings - Fork 145
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
New check: Trailing comma in enum similar to array initializer #464
Comments
please review recent issues to see what is required to discuss (names, config) before implementation to avoid extra coding/refactoring/.... . |
This checks that the last enum constant definition in a multi-line enum ends in a comma: enum E1 { ONE, TWO, THREE, } Addresses sevntu-checkstyle#464
This checks that the last enum constant definition in a multi-line enum ends in a comma: enum E1 { ONE, TWO, THREE, } Addresses sevntu-checkstyle#464
This checks that the last enum constant definition in a multi-line enum ends in a comma: enum E1 { ONE, TWO, THREE, } Addresses sevntu-checkstyle#464
Provide examples for the check and extend the rationale behind it. Addresses sevntu-checkstyle#464
The default branch on the previous switch did not do anything and should not have raised an exception, which would be invalid for single-line enums. Addresses sevntu-checkstyle#464
This Check assures that the last enum constant definition in a multi-line enum ends in a comma: enum E1 { ONE, TWO, THREE, } Original PR: sevntu-checkstyle#465 2016-07-29 -- 2016-08-26
This Check assures that the last enum constant definition in a multi-line enum ends in a comma: enum E1 { ONE, TWO, THREE, } Original PR: sevntu-checkstyle#465 2016-07-29 -- 2016-08-26
This Check assures that the last enum constant definition in a multi-line enum ends in a comma: enum E1 { ONE, TWO, THREE, } Original PR: sevntu-checkstyle#465 2016-07-29 -- 2016-08-26
…turn statements, trailing comments
Referenced PR was not finished (but functionally it works, but still require minor changes to be completed) and abandoned .... . Everyone is welcome to continue. |
https://checkstyle.org/config_coding.html#UnnecessarySemicolonInEnumeration is about |
Hey @kariem @yaziza |
@DmytroBarabash I have created #465, #474, #709, #722 to address this issue and with every change the maintainers found new things that needed to be addressed before merging anything. Effectively, this was not much work on the implementation side. However, the requests in the PRs increased the required work by at least a magnitude. Instead of just changing wording here or there to better fit with what the maintainers expected, there were just more and more changes after addressing an issue. I did not see an end to the additional requested changes and it did not seem as if the work put into the changes were appreciated at all. The last comment even suggested to just rename everything, more than 2 years after the first commit. |
@kariem I see. I read one of those threads. My condolences. Now I understand why checktyle still doesn't have so useful check. When you expected an easy walk, but it turned out that you have to fight a dragon ( |
Please do not expect quick progress as maintainers of this project are same as checkstyle/checkstyle repository. There are huge amounts of issues and PRs. Please review review all PRs, grab code from them, do all changes that were requested but not done, make code as if it would be your code. |
copied from checkstyle/checkstyle#3161
Similar to ArrayTrailingComma there should be a check for trailing commas in enum constants. A lot of enums are used to map to values from somewhere else and it might be necessary to adapt them often.
The check verifies that the last element of a multi-line enum constant definition has a comma:
Check ok:
Check failed:
I stumbled across this while writing how to check for trailing commas in arrays and enums based on an article discussion JavaScript.
The text was updated successfully, but these errors were encountered: