Issue #18435: Fix xdocs Examples AST Consistency Test - parenpad#19983
Conversation
|
Github, generate site |
| catch(Exception e ) {} // violation 'not followed by whitespace' | ||
| for ( int i = 0; i < x; i++ ) { | ||
| // ok | ||
| // ok |
There was a problem hiding this comment.
@smita1078 , please check why there is no violations on file with simple // ok comment?
I thought we forbid it in all inputs. It should be always with details on why is ok and removed.
In your case it should be removed and empty line states.
There was a problem hiding this comment.
I checked the configuration and noticed that the Regexp module is currently placed under TreeWalker.
https://github.com/checkstyle/checkstyle/blob/d4c29c07597995ca1cb4d87227a62984cbd1f338/config/checkstyle-input-checks.xml
<module name="TreeWalker">
...
<module name="Regexp">
Since Regexp is a Checker-level check and not a TreeWalker check, it looks like the configuration is not being applied for these comments currently. That is likely why existing plain // ok comments (for example in ParenPad inputs) are not reporting violations.
For this case, I will remove the unnecessary comments and keep empty line states instead.
There was a problem hiding this comment.
Also, should I create a separate issue/PR to move this Regexp check to the Checker level so these comments are properly validated repository wide?
There was a problem hiding this comment.
Separate Issue and PR.
We need to prevent this bad pattern in examples. Thanks a lot for investigation
fefebf3 to
8250dfd
Compare
|
Github, generate site |
|
From html page:
This looks like use case without config. If you agree, please create issue will update it as we deal with Use cases. All good, as two issues created we can merge. |
Will we create examples for such case under use case sections?? or just move this under use case sections? #19994 |
Issues and PR #19998 is created, I guess we can merge this! |
|
GitHub, generate website |
#18435
parenpad
Example1.java -> default config
Example2.java -> token property (unique)
Both in section1.