Issue #11166: remove getFileContent() usage from FallThroughCheck#12966
Issue #11166: remove getFileContent() usage from FallThroughCheck#12966nrmancuso merged 1 commit intocheckstyle:masterfrom
Conversation
|
Regression :- https://kevin222004.github.io/Regression/ |
9e57997 to
36db4b4
Compare
src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/FallThroughCheck.java
Outdated
Show resolved
Hide resolved
|
@romani please look at the config of this file and this part of code isn't it a violation ? can we update the documentation of https://checkstyle.org/config_coding.html#FallThrough:~:text=To%20configure%20the%20check%20to%20enable,have%20statement%20that%20transfer%20control%0A%20%20%20%20i%2B%2B%3B%0A%7D as per the doc the code example i provide must be violation |
@Kevin222004 please reproduce by CLI to make it clear what you are asking; to me it looks like while we do have checkLastCaseGroup=true, we also have fall through comment to suppress violation. Am I missing something? |
|
can you please explain the checkLastCaseGroup i have read the docs but i think still i don't gain proper knowledge of it in cli output is perfect but in input file it is not showing violation for line 16 which i have pointed in #12966 (comment) let me push the new changes so you can see the change properly |
|
@Kevin222004 take a look at your config: With our inline config parser, we use |
|
#12966 (comment) noticed after making pr i have changed only 1 input file. |
c4c7b34 to
8db2486
Compare
It might be a good idea to work on #12974 and play around with check via CLI to understand check behavior, I find that writing documentation always helps me to get a clearer idea about a concept. If we can improve documentation about this property, please do. |
|
@nrmancuso @romani i have got that what does checkLastCaseGroup do and i have removed the changes in input you can check and start review |
|
@Kevin222004 please generate regression report by Github action with a few different configs now that we have pushed changes |
|
pmd failure is not expected will solve it and then generate regression |
|
direction is good. |
|
@Kevin222004 please create test input mentioned at #12950 (comment), since we closed that PR in favor of this one. |
|
#12966 (comment) done |
|
https://kevin222004.github.io/Regression/ looks fine |
|
please continue review |
|
Very good. |
|
@romani #12966 (comment) done |
yes, it is, we should update our test Input files to not mention keyword "fall through" in violation message We might use
I pretty sure we discussed this situation above and agreed to make it as regression but mark as "until #....". |
|
Fix violation |
c413e88 to
2d6d450
Compare
src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/FallThroughCheck.java
Show resolved
Hide resolved
src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/FallThroughCheck.java
Outdated
Show resolved
Hide resolved
src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/FallThroughCheck.java
Outdated
Show resolved
Hide resolved
src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/FallThroughCheck.java
Outdated
Show resolved
Hide resolved
src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/FallThroughCheck.java
Outdated
Show resolved
Hide resolved
src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/FallThroughCheck.java
Show resolved
Hide resolved
src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/FallThroughCheck.java
Outdated
Show resolved
Hide resolved
nrmancuso
left a comment
There was a problem hiding this comment.
Looking a lot better, one last item:
src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/FallThroughCheck.java
Outdated
Show resolved
Hide resolved
|
After working too much on this check I still feel that my concept is not clear related to this check. All the reviewers please share thoughts on #13545 (comment) The most confusing part of this whole PR is related to this issue #13545 I am not sure this is happening with me only or what but I think it needs discussion to decide some proper rule. |
|
@Kevin222004 , please fix https://ci.appveyor.com/project/Checkstyle/checkstyle/builds/47885530/job/juiya9s7rrnd2wg0#L1794 |
|
@nrmancuso , PR is ready for final review |
|
@Kevin222004 please generate reports one last time before we merge |
|
Github, generate report |
|
Github, generate report |
Resolves #12948
partial for Issue #11166: remove getFileContent() usage from FallThroughCheck
Regression
final report :- https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/b242e7a_2023192425/reports/diff/index.html
final report 2 :- https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/b242e7a_2023213303/reports/diff/index.html
Diff Regression config: https://gist.githubusercontent.com/Kevin222004/ebc8a446892fe0a9aaf746b1b1b43c05/raw/4e77df9181e2cbd8dd9e227169310190e2eb8f5b/fall.xml
Diff Regression projects: https://gist.githubusercontent.com/Kevin222004/9600f179b602d4c971bdb0a050099005/raw/360a95ed7bb60d7a0956e531199d484c4d6f6617/test-projects.properties
Report label: final-report-2.1