-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Issue #17728: Add support for TYPE token in WhitespaceAfterCheck #18048
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
base: master
Are you sure you want to change the base?
Issue #17728: Add support for TYPE token in WhitespaceAfterCheck #18048
Conversation
|
GitHub, generate report by config from src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/whitespaceafter/InputWhitespaceAfterType.java |
|
|
||
| followedByWhitespace = codePoint == ';' | ||
| || codePoint == ')' | ||
| || codePoint == ',' |
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.
One problem is that this change has an impact on other tokens (not only on TYPE), because the method is shared.
|
Report generation failed. Please check the logs for more details. |
|
This approach for triggering will not work, as no such token in master branch of checkstyle. |
|
Github, generate report |
|
There are cases where this solution becomes opinionated: For example Or Or C-Style Arrays IMO, we should create a new check for square brackets only - similar to GenericWhitespace. |
Thanks a lot for analysis. Please create new issue, let's agree on naming, this PR should be linked as justification on new Check. |
Issue
Description
PR is still in draft state. We have to decide if it's maybe better to make a separate check for the problem in the PR - #17728 (comment)
TODO
src/it/resources/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespaceDiff Regression config: https://gist.githubusercontent.com/stoyanK7/c945ccc86ba9c276b8273166450310a1/raw/fadc1096c3837004872272371b8bff5455e8da2a/config.xml
Diff Regression patch config: https://gist.githubusercontent.com/stoyanK7/0b4ea73cb2d6f5446636dbe769394efb/raw/974d365b3b8b442e0fb38e479e2a4e9486e39ced/gistfile1.txt