-
Notifications
You must be signed in to change notification settings - Fork 170
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
proposal: comment_all_ignores
#4860
Comments
<comment_all_ignores>
comment_all_ignores
I'd love this rule. I miss it often, from other linters, haha. |
Yeah, also you would have to add an ignore comment to ignore this rule :) // ignore: comment_all_ignores, because it's getting annoying
// ignore: some_lint |
@goderbauer: I'm guessing this'd be used at least for the flutter repo and maybe flutter recommended style? @bwilkerson, @scheglov, @srawlins, @keertip, @kallentu: I wonder if this is something we'd consider for analyzer? |
I would love to enforce this for the flutter repo. Not so sure about putting it in the flutter recommended style set, though, since it isn't really a lint specific to flutter code. Since it is about general dart code, if we think this is useful we should align across the dart universe and put it in the general recommended set. |
In order to land this new rule, I add a new `IgnoredElement` subclass, `IgnoredDiagnosticComment`, for any trailing comment text. This seems like a pretty clean implementation. The text and offset are not used, but it seems like it would be inconsistent to not offer them. I also make a few IgnoreInfo fields private that are unused outside the library. Fixes dart-lang/linter#4860 Change-Id: Id6f949a317929dae8833e404d4c9f3c8e4f7bc90 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365488 Commit-Queue: Samuel Rawlins <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]> Reviewed-by: Phil Quitslund <[email protected]>
Implemented in dart-lang/sdk@607b3f5 |
yay! |
comment_all_ignores
(See notes on naming in Writing Lints.)
Description
A short description suitable for display in console output.
Missing a required ignore reason. Try adding a reason for this ignore after the rule name separated by a comma.
Details
A detailed description that provides context and motivation. Can be used directly in the rule's documentation.
From the Flutter Style Guide:
Kind
Enforces style advice.
Copied from the Flutter Style Guide.
Bad Examples
A few examples that demonstrate where this lint should fire.
Good Examples
Here are a few examples that demonstrate a “good” adoption of this lint’s principle.
Discussion
Add any other motivation or useful context here.
Conflicts
This lint may be self-conflicting, i.e. the user may actually have to specify a comment on the ignore to ignore this rule.
Other
Once this lint gets approved, a further lint may be
ignores_same_line
, which will lint against multiple ignores on the same line.Discussion checklist
setStateIfMounted
is from a utility in one of my real-life private repositories.The text was updated successfully, but these errors were encountered: