-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Remove '//ok' comments from Input files #13213
Comments
@Vyom-Yadav , @Kevin222004 , @rdiachenko , @nrmancuso , please share your opinion on this issue. |
Agree 100%, I think overuse of comments diminishes the concision of examples and inputs. |
Agreed, let's only permit // violation and // ok, because of ........ |
I also agree to remove // ok. |
+1 |
@stoyanK7 , please share your position on this |
I also agree with removing |
@rnveach , please share your thoughts |
@sheetalj2205, we are ready to start removal. Referenced PR is merged. |
Okay, I am on it. |
Hello @romani I just want to check before moving forward whether I understood it correctly or not, as we can see in these files InputDefaultComesLastDefaultMethodsInInterface.java and illegaltype/InputIllegalTypeEmptyStringMemberModifiers.java there are multiple //ok comments, we need to remove that and put it only at one place that is after class or interface name and I am supposed to do that for all the files of com.puppycrawl.tools.checkstyle.checks.coding package. |
We need to remove all |
can you please assign this to me |
@sheetalj2205 we do not assign issues except to maintainers, just make a comment like “I am on XXXCheck” and send a PR. |
@sheetalj2205, just make comment "I am xxxxxCheck tests" and send PR for single Check only. After we merge first PR you can send PRs for more, by group. We do not allow huge PRs that change all, such PRs usually never come to merge state. |
I am on MethodParamPadCheck |
…dProtectedScope
…dProtectedScope
…ntLocationTrailingSpace
After hundreds of example PR reviews, I , and not only I found that comment
ok
is just a noise that makes it hard to read.This example is small, so you will not fill pain, but, there are more complicated examples and it is not good.
I agree to put comment to explain some not obvious reason, but it will be exception.
For now I treat all
//ok
comments as stuff to remove, there might be cases to keep them as form of:// ok, here is not obvious reason
// ok, here is pointing to Check limitation
In short - when it is not obvious.
all suppression
<suppress id="UnnecessaryOkComment"
for at https://github.com/checkstyle/checkstyle/blob/master/config/checkstyle-input-suppressions.xml should be removed and referenced files updated to not have "// ok" commentsWe do need this removals in test inputs.
Same is for Example files, it just makes example full of content that is hard to distinguish without code coloring.
user should see is comment as red flag of attention.
All other lines are without attention, as no violation on them, on all of them.
We use to have such comments only at times when we had no enforcing and it was very manual markers , but it lost its role after we finished Input based tests
Such
ok
comment become to appear in completely unrelated places, by copy paste, and keep it at right place is not possible( or hard and outside of this project). Better without it .Location of violation comment is enforced by runtime - never outdated.
Please choose name of module from file:
checkstyle/config/checkstyle-input-suppressions.xml
Lines 68 to 70 in b6301c1
where name of module is
equalsavoidnull
and send PR for all files that belong to it in single PR.final goal is to remove all suppressions of "UnnecessaryOkComment".
Example of update: https://github.com/checkstyle/checkstyle/pull/13609/files attention on removal of suppression
See more examples below for "Merged" Pull Requests.
The text was updated successfully, but these errors were encountered: