-
-
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
Update AbstractChecks to log DetailAST (part3) #5777
Comments
How do we want to report handling a violation on a comment's specific line number? There is no AST inside the comment for a specific line. The AST will point to the start of the comment and the Also how do we want to handle checks that don't even use the AST? I made an issue before that they should be changed to FileSet checks, but that was denied. |
28 checks fit into the easy category where we just do |
I do not know for now. It is better to postpone comment related Checks to most end of this project.
I would not doing this for now. Violation on AST will help extensions to do autofixes. Comment related violation is still unclear area. Let's postpone such Checks.
No AST no Xpath. They should continue to use any other way of suppression. |
We can't reconsider changing to a FileSet? We broke configurations when we did the same for Filters. |
do you remember in what issue I rejected such proposal? We need to think about this one more time. So we can update such Check to report violation on first AST in this line now ..... and in separate issue discuss reasons of Check to be under Treewalker. |
#2116 . Different check then mentioned here, but still same issue. |
conversion to FileSet is kind of reasonable but should be done with special attention and separately from Xpath project. |
PR #6199 is abandoned but anyone can take the code and finish it. Latest commit was rnveach@128bd56 . What still needs to be done is we need a bunch of regression tests to show that xpath suppression works before we merge these changes. These tests will be located at https://github.com/checkstyle/checkstyle/tree/master/src/it/java/org/checkstyle/suppressionxpathfilter. This is similar to Issue #6207 but we need regression for the checks specifically modified in this issue. |
This issue is being closed as it was split into its children |
Checkstyle has recently started to update old checks from logging on the line/column, to log on the AST node. This is needed to support https://checkstyle.org/config_filters.html#SuppressionXpathFilter which needs the AST of the violation to match it to the user supplied XPath.
As PR is started for each check, links from master ( Ex: https://github.com/checkstyle/checkstyle/blob/master/src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/EmptyBlockCheck.java#L201 ) must be posted to show each log call found in the check. An additional note must be made of the number of logs actually modified. This will greatly help admins ensure the full check is now xpath compliant and nothing is missed.
All checks need to be reviewed to ensure:
log
pass the AST and not the line/column1: We don't expect drastic change in current UTs when making the switch. If any items change the line/column drastically, please point them out to be clear to admins in the PR. Adding a column number when no was there before is ok and an expected change.
2: Must have a UT for each log in the check. If the check has 3 separate log calls, then it must have 3 separate UTs.
4: In report for each project,
Number of unique base messages reported below
andNumber of unique path messages reported below
should match otherwise it is saying there is an uneven amount of changes, either new violations or violations removed. We aren't expecting this type of change in these PRs unless you can account for it. One example where it would be acceptable is if duplicate violations on the same line were being dropped as we only report 1 violation per line/column/message/check.The text was updated successfully, but these errors were encountered: