-
Notifications
You must be signed in to change notification settings - Fork 123
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 to and fix latest lints #1335
Conversation
|
||
analyzer: | ||
errors: | ||
comment_references: ignore |
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.
LOTS of failures here!
include: package:lints/recommended.yaml | ||
linter: | ||
rules: | ||
- avoid_dynamic_calls |
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.
all of these are in dart_flutter_team_lints
@@ -312,7 +313,7 @@ class CommentSequence extends ListBase<SourceComment> { | |||
SourceComment operator [](int index) => _comments[index]; | |||
|
|||
@override | |||
operator []=(int index, SourceComment value) => | |||
void operator []=(int index, SourceComment value) => |
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.
This return type is pointless. Index setters are like setters: they can never return a value anyway.
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.
Generally agree, so maybe the lint needs to be updated for this case!
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 believe the lint is doing the right thing. I enabled always_declare_return_types and tested it on:
class Foo {
get getter => 1;
set setter(int value) => 1;
method() => 1;
operator [](int index) => 1;
operator []=(int index, int value) => 1;
}
I get lint warnings on getter
, method()
, and operator []
, but not setter
or operator []=
. Maybe the fix is out of sync with the lint? Or maybe this was just a mistake fixing the lint? Either way, I think you can delete this void
and it should still be lint clean.
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.
This LGTM, but note that I have a very large PR out (#1336) that will probably collide with this in nasty ways and I really don't want that PR (which is blocking any other progress on the new back end) any harder to land than it already is.
Would you be OK with waiting until that's in and updating this PR with those changes first?
No description provided.