feat: Add the option ignored-patterns
to the rule format-comment
#828
feat: Add the option ignored-patterns
to the rule format-comment
#828
Conversation
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.
Thank you for adding this option!
Am I correctly getting the ignored-patterns option from the config
Yes, every thing is fine, but I left few small comments just to keep the codebase in the same code style. Could you address them?
lib/src/analyzers/lint_analyzer/rules/rules_list/format_comment/format_comment_rule.dart
Show resolved
Hide resolved
@@ -11,6 +11,10 @@ const _ignoreExp = 'ignore:'; | |||
const _ignoreForFileExp = 'ignore_for_file:'; | |||
|
|||
class _Visitor extends RecursiveAstVisitor<void> { | |||
_Visitor(this._ignoredPatterns); | |||
|
|||
final Iterable<RegExp> _ignoredPatterns; |
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.
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.
I moved the variables in this commit: 5ef8885
lib/src/analyzers/lint_analyzer/rules/rules_list/format_comment/format_comment_rule.dart
Outdated
Show resolved
Hide resolved
To update the website, you need to change this file https://github.com/dart-code-checker/dart-code-metrics/blob/master/website/docs/rules/common/format-comment.md. Here is an example https://github.com/dart-code-checker/dart-code-metrics/blob/master/website/docs/rules/common/no-equal-arguments.md Please also add the |
I updated the documentation in this commit: 6288e6f Tell me if this is too specific/not good enough |
ignored-patterns
to the rule format-comment
ignored-patterns
to the rule format-comment
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.
LGTM 🚀
Codecov Report
@@ Coverage Diff @@
## master #828 +/- ##
==========================================
+ Coverage 87.25% 87.34% +0.08%
==========================================
Files 279 280 +1
Lines 5932 5941 +9
==========================================
+ Hits 5176 5189 +13
+ Misses 756 752 -4
Continue to review full report at Codecov.
|
What is the purpose of this pull request? (put an "X" next to an item)
[ ] Documentation update
[ ] Bug fix
[ ] New rule
[x] Changes an existing rule
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:
Should close #826
What changes did you make? (Give an overview)
I added the option
ignored-patterns
(a list of strings that will be used as regexes) to the ruleformat-comment
to be able to ignore some kind of comments.Is there anything you'd like reviewers to focus on?
Am I correctly getting the
ignored-patterns
option from theconfig
? I didn't find how to test it myself (e2e test) and make sure my code is actually working.Also, do I have to apply any change to your web site? If yes, how?