-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Generic.Commenting.Todo.CommentFound sample not working #3769
Generic.Commenting.Todo.CommentFound sample not working #3769
Comments
@davidsneighbour I've just tested and confirmed this issue, however, if you look at the sniff, you will see that the To me, this looks more like something which needs to be improved in the sniff itself. Most notably - it looks like the sniff looks at all comments and checks if they start with |
@davidsneighbour I've opened PR #3771 with some improvements for the Note: when there is a "todo description", the error code for the sniff is different (and always was), so your ruleset would not work as-is, you'll need to update it to: <!-- This error code is for when no description is found. -->
<rule ref="Generic.Commenting.Todo.CommentFound">
<message>Please review this TODO comment</message>
<severity>3</severity>
</rule>
<!-- This error code is used when a task description is found. -->
<rule ref="Generic.Commenting.Todo.TaskFound">
<message>Please review this TODO comment: %s</message>
<severity>3</severity>
</rule> |
The Line 215-218 <rule ref="Generic.Commenting.Todo.CommentFound">
<message>Please review this TODO comment: %s</message>
<severity>3</severity>
</rule> Should be: <rule ref="Generic.Commenting.Todo.TaskFound">
<message>Please review this TODO comment: %s</message>
<severity>3</severity>
</rule> And |
@stevenfoncken Thanks for pointing that out. I've updated the wiki page now. |
Describe the bug
I configured my
Generic.Commenting.Todo.CommentFound
setup according to the docs in the wiki..There is more in the config, but I left it out for readability (full config at the end).
I would expect the following to throw an error like
Please review this TODO comment: @todo find out if this maybe is better suited at another location
orPlease review this TODO comment: find out if this maybe is better suited at another location
. But it throws onlyPlease review this TODO comment:
. It's notable in VSCode and on the CLI that two spaces are there at the end, as if %s is returning empty at that point.Code sample
This happens with ANY
@todo comment
comment.Versions (please complete the following information):
Complete config:
The text was updated successfully, but these errors were encountered: