-
-
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
Issue #14620: LITERAL_CASE
token support in RightCurlyCheck
#14623
Conversation
LITERAL_CASE
token support in RightCurlyCheck
5b16a01
to
00173b6
Compare
@nrmancuso @rnveach can you guide me on how to solve this CI failure related to checker I am not familiar with it also the purpose of this function is to skip switch expressions when we checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/RightCurlyCheck.java Lines 462 to 472 in 7e9960b
and please review changes if all is good |
Let's wait until we are getting close to merge to deal with this, code might change by then :) But what Checker is telling us is that basically it expects the DetailAST to be non-null, and you are passing in a potentially null object instead.
Ah, I had forgotten about this. I do not totally understand this "limitation", but since we have an open issue on it, let's also avoid switch expressions here. You can use So, the answer to
is yes. Make sure we have some in our inputs to verify this behavior. Looking good so far! |
@mahfouz72 I am going to place this PR into draft mode while you keep working :) |
63d41ef
to
8119c30
Compare
Github, generate report |
Github, generate site |
Report generation failed on phase "make_report", |
Github, generate report |
8119c30
to
bb961ec
Compare
Github, generate report |
Github, generate report |
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.
@mahfouz72 let's try to make Checker happy and place @Nullable
annotation on Details
constructor arguments lcurly
and rcurly
. If this doesn't help, we can just update suppression file.
Github, generate report |
bb961ec
to
be32a25
Compare
this works but produced new survivals
|
be32a25
to
ea0d14e
Compare
8b3c959
to
3d6464f
Compare
@nrmancuso checker is falling even after adding suppression build successbut process exit with code 1 idk why. also Please Check PR description for report and site |
bf6da15
to
da58ea6
Compare
@rnveach ping |
I see production code changes after #14623 (comment) , so we need a new report. |
Github, generate report |
I think I am good with the PR. I want to review the latest report first. |
@rnveach here is the latest report
this will be more reasonable when we add support for default. I opened an issue for this and will add support for default after merging this PR what do you think is it normal to validate this |
How does LeftCurly handle this case if only |
da58ea6
to
4963a67
Compare
4963a67
to
ddf54a1
Compare
Github, generate report |
Please let me know what to expect from #14623 (comment) . |
leftCurlyCheck handles it differently. the braces in our example are not considered with case they are considered with the default only and this is correct IMO, So I made a small change to handle it as leftCurlyCheck does for leftCurlyCheck when
so we should expect now after the last change. that this should have no violation |
@rnveach report is good. The violation was removed from #14623 (comment) and there are no differences between the last report and the previous one rather than this case. I think we are good to go now |
@mahfouz72 Did you regenerate all 3 reports in #14623 (comment) ? I would want to see all 3 since this is a new token and it has many different options. |
Github, generate report |
Github, generate report |
@rnveach please check #14623 (comment) reports for all 3 options has been regenerated and all lgtm |
Resolves #14620 :
Diff Regression config: https://gist.githubusercontent.com/mahfouz72/c82dbc1b4a05567e245729eccfc6cf62/raw/c4958b5ee00ded9c8f89d3af0a50fa871b352205/rcurlybase.xml
Diff Regression patch config: https://gist.githubusercontent.com/mahfouz72/fb26eda6b5a3264c0c42351e612cc4f6/raw/daf318509889f654cd61d58c9e039c9ba1505716/rcurlypatch.xml
Site (link)
Reports
alone option (link)
alone_or_singleline option (link)
same option (link)