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 #11655: allow suppressing Google style warnings with annotations and comments #11656
Conversation
src/main/resources/google_checks.xml
Outdated
@@ -106,8 +116,7 @@ | |||
<property name="tokens" | |||
value="COMMA, SEMI, TYPECAST, LITERAL_IF, LITERAL_ELSE, LITERAL_RETURN, | |||
LITERAL_WHILE, LITERAL_DO, LITERAL_FOR, LITERAL_FINALLY, DO_WHILE, ELLIPSIS, | |||
LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_CATCH, LAMBDA, | |||
LITERAL_YIELD"/> | |||
LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_CATCH, LAMBDA"/> |
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.
LITERAL_YIELD
would raise an error in my env which reads this token is not recognised
com.puppycrawl.tools.checkstyle.api.CheckstyleException: cannot initialize module TreeWalker - Token "LITERAL_YIELD" was not found in Acceptable tokens list in check com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck
at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:476)
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:201)
at com.puppycrawl.tools.checkstyle.Main.runCheckstyle(Main.java:403)
at com.puppycrawl.tools.checkstyle.Main.runCli(Main.java:330)
at com.puppycrawl.tools.checkstyle.Main.execute(Main.java:189)
at com.puppycrawl.tools.checkstyle.Main.main(Main.java:126)
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Token "LITERAL_YIELD" was not found in Acceptable tokens list in check com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck
at com.puppycrawl.tools.checkstyle.TreeWalker.registerCheck(TreeWalker.java:223)
at com.puppycrawl.tools.checkstyle.TreeWalker.setupChild(TreeWalker.java:133)
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:201)
at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:471)
... 5 more
Checkstyle ends with 1 errors.
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.
Looks like this change has broken the unit tests. I didn't look into why it would fail. I'll push it until I find out
@ddcprg issue is approved, please see #11655 (comment) and make CI happy |
@ddcprg, ping |
@romani I have time to look at this later today |
c5151fd
to
3ba2e78
Compare
@romani @nick-mancuso please feel free to review any time now |
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.
Items:
f009c5b
to
4c6c10d
Compare
@nick-mancuso changes made, please feel free to review again any time |
Github, generate site Link to relevant documentation: https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/4c6c10d_2022143701/google_style.html#Google_Suppressions |
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.
We do not have a testing structure in place to test config with suppressions for google style (not that I can find, anyway). Please show CLI output with your new config file and working example with suppressions in place. We can use parts of your example to address the below item:
Item:
@nick-mancuso the suppressions section doesn't look very clean with the new details, I can make easier to read if you agreee |
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.
Items
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.
Items
@ddcprg, ping |
f68a96d
to
1d44145
Compare
@romani I can't find the link to the generated site, would you mind telling me where to get it from? |
Github, generate site |
To generate it locally https://github.com/checkstyle/checkstyle/wiki/How-to-run-certain-phases-and-validations#how-to-generate-website-only |
thank you @Vyom-Yadav @romani @nick-mancuso let me know if the docs look good enough https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/1d44145_2022082908/google_style.html |
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.
Items
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.
Items
…annotations and comments
Github, generate site |
@romani I've made the changes you have requested https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/cf2a79c_2022063340/google_style.html |
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.
Ok to merge
@romani I still can't merge the PR, if you can please press the button |
Only maintainers can merge. We removed holder from documentation as it is very technical details. It same mention about TreeWalker when you mention about Check. If user activate Check it has to place in config TreeWalker. Same with annotation based filter, holder must be placed in config in same time. |
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.
@ddcprg thanks a lot for making this happen!
Fixes #11655