-
Notifications
You must be signed in to change notification settings - Fork 146
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
Issue #464: Check for trailing commas on enums #474
Conversation
@romani Ping. |
@kariem , sorry for delay, I was too busy with main project (checkstyle). ok, so implementation did change from previous PR.
Name of the Check I could merge this Check to sevntu (this is whole purpose of this project), but I will be against this Check movement to main project (checkstyle). So, it is time to make a decision, fortunately now we have @rnveach for second opinion. @rnveach , please let us know your opinion. Options:
|
@romani No one will remember this conversation later, so if we can, let's get everything done now. |
@kariem , ping. |
Sorry for the delay. I just do not see why something like this can take so long. I had to take some time to write this together. It's important to me to solve this and I am quite sure quick shots, one-liners and minimal effort won't make us complete this soon. It seems @romani, you are in a lot of different places, and it's difficult to follow through. I can understand that. Let me wrap up here quickly.
I think the name is good, that's why I chose it. I've summed up my thoughts previously. In my personal opinion, I expect the check for ArrayTrailingComma do the same thing as a similar check on enums. It is clear to me that such a check has to do a little bit more than a check on arrays, because there can be more "content" after the enum constants (i.e. the body). In JavaScript, there is one check in ESLint for this: comma-dangle. It's used for everything: arrays, objects, imports, exports, and functions. In Java, we cannot use the same mechanism, but we should at least for the sake of a user make it simple. Please choose a name. I can throw in my opinion, if requested, or start a doodle on the mailing list or anywhere you like. I just won't suggest a different name, because I strongly believe that the current name is good, and the suggested alternatives are worse. Please assess the arguments yourself or include anyone you want to include. Here is what I see against and for the current name: ➖ Documentation: A check should only do what it says it does. Please accept the changes we have now. We can always change everything later, if we see better options. I can do the necessary work. |
@kariem ,
I am not sure about your decision. Please state it clearly.
My proposal: EnumTrailingCommaAndSemicolonCheck |
@romani: sorry for the ambiguities. I will make this more explicit:
|
@kariem Please rebase over latest master and fix any failing tests or code style errors. Check must be added to config. Check must be added to sonar and eclipse-cs. New code styles are being enforced on code. If you do make these changes, I also ask that you please rename check to |
59432bb
to
e5f09e5
Compare
@rnveach I have now rebased on master and renamed class and test class as requested. It's great that you have new code style errors, but clean up your code first, before you introduce it on new changes. This is not very professional. Is there a reason why you guys are blocking this pull request? Is this on purpose? The class |
@kariem
https://travis-ci.org/sevntu-checkstyle/sevntu.checkstyle/builds/181098451#L649
Yes. |
e5ba818
to
594704b
Compare
@rnveach Thank you very for the quick reply. I did not expect this. Problems related to imports seem to be resolved now. I use IntelliJ IDEA and the instructions for the imports are here - just a reference. One more request: Could you please elaborate on the other additional requests (config, sonar, and eclipse-cs) in your previous comment? Is this documented somewhere? I've seen the CI fails for two cases:
It also fails on the commit message on the initial commit! This currently looks like this
See e5f09e5 Why would you do that? The commit comment describes what has changed and nobody expects to go to the issue tracker for every minor detail. How can the commit describe an issue like this in a single line? |
594704b
to
be77aae
Compare
The documentation is: https://github.com/sevntu-checkstyle/sevntu.checkstyle/wiki/What-files-need-to-be-changed-or-created-in-repository-for-new-Check-implementation Changes are expected in: You can look at existing checks and follow the same suite. JUnit will guide you through most of it if you make a mistake.
Copy and paste as is. No
Written in original issue by romani:
|
be77aae
to
2d71cef
Compare
2d71cef
to
99f7748
Compare
@rnveach Thank you for the quick answers. I've now updated as requested. All the configuration files have been updated. However, the build fails, because some files don't adhere to the newly introduced check ref. That check is not useful: we cannot test that the source of sevntu adheres to all possible checks that can be configured in sevntu. There may be conflicts between different checks. |
@rnveach to conclude this, I have added one more commit to resolve the last error reported by CI: cdc74e8. Seems to be ok now. Either this should be configurable, or I missed something. Anyways, I think the current configuration is not reasonable. All these artificially strict rules discourage contributions. Please indicate, if there is something else to be done. From what I see, I have followed all your instructions and requests. |
yes, it is discourage contribution for some time, but attract new contributors in future as code is clean, and welcoming other contributor come to your code. Nobody wants to go to badly written code, especially for free (opensource). If you still do not understand .... just keep it as our rules. |
@kariem , please do more items:
Please squash all functional commits (introduction of Check) in one commit. All changes in sevntu code that was caused by new Check in unrelated files, please do in separate commit of the same PR. There should be clear where is new functionality and where is affect of it. I did not found any testing reports of new Check. |
@romani please don't ask me to "please follow the rules", if this is what I am doing. You should strongly consider improving your workflows or your documentation. I am suggesting improvements. If you cannot accept suggestions, it will be difficult for you to find additional contributions. I am not saying I know better, but I have to point out that this process does not seem to work. This is unreadable. How can I provide a patch? Checking out the project does not work because of the file names:
On a side note, please look at #465 to see what we have discussed already and just imagine what a motivated contributor has to do to get his work included in this project. Please note that everything was considered completed already -- with your confirmation -- and you keep adding additional tasks to a very simple change. This is not professional. This is not your day job and I assume you don't get money for this, however, if you say you are responsible, it is your job.
The last two items are
Ad (1): I've opened #3163 in May and I will create a pull request on Checkstyle as soon as this is pull request is accepted. We have to take one step after the other. How can I update Checkstyle, if you haven't even accepted any of the changes here? Ad (2): Please explain how I can change the default configuration on the website.
I won't work around everything again. I need one ok from you or @rnveach on the current state and be sure that nothing else comes my way. How can I continue, if we keep playing ping pong? This is not fun for me. I also have a day job and a lot of other things on my list, and I cannot keep changing the commits just because you don't want to confirm my contributions.
I have just run against the current my_check.xml and one test with only this check as module. Versions used:
The results from the Please suggest how we can move forward. |
unfortunately github does not allow PR to wiki :( . This is still undone for many years.
please provide more details from your side.
Sorry, I am not 100% focused on this project, I could loose a context.
easy. PR with fixes in code and update of config will hang till I do release of sevntu. I will not need you to help, rease is done, PR is merged.
easy, just perform all points and I will merge you quickly. All follow such rules, you will not be exception.
please read README for checkstyle-tester, we need report to be placed to web as web site (to github.io if you do not have anything else) |
@kariem , ping . |
@kariem , ping. |
@kariem , ping. |
2a60e6f
to
cdc74e8
Compare
@kariem Are you planning to finish this? I see you made a new push. |
- Adapt base class for test - Update copyright in header for EnumTrailingCommaAndSemicolonCheck.java and EnumTrailingCommaAndSemicolonCheckTest.java - Rename input file to match check: InputEnumTrailingComma → InputEnumTrailingCommaAndSemicolonCheck
0b25a9b
to
81ddb7b
Compare
@rnveach thank you for the recommendation. Just saw that there are a few new checks that haven't been considered by my previous code. |
CIs failures should be resolved. All should be green. |
Closing this as it is being moved to a new PR. |
This Check assures that the last enum constant definition in a multi-line enum ends in a comma:
Adresses #464, supersedes #465.
Usage examples are in the Javadoc of
EnumTrailingCommaCheck
. This check follows the concept of ArrayTrailingComma, hence the similar name.It also checks that the "trailing" comma after the last enum constant definition is not followed by a semicolon, because this would miss the point of the check: clean diff and easy manipulation.