Skip to content
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

Merged
merged 5 commits into from
Dec 6, 2023
Merged

Update to and fix latest lints #1335

merged 5 commits into from
Dec 6, 2023

Conversation

kevmoo
Copy link
Member

@kevmoo kevmoo commented Nov 28, 2023

No description provided.


analyzer:
errors:
comment_references: ignore
Copy link
Member Author

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
Copy link
Member Author

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

example/format.dart Outdated Show resolved Hide resolved
lib/src/argument_list_visitor.dart Outdated Show resolved Hide resolved
lib/src/dart_formatter.dart Outdated Show resolved Hide resolved
lib/src/front_end/comment_writer.dart Show resolved Hide resolved
@@ -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) =>
Copy link
Member

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.

Copy link
Member Author

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!

Copy link
Member

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.

lib/src/front_end/delimited_list_builder.dart Outdated Show resolved Hide resolved
lib/src/line_splitting/solve_state_queue.dart Outdated Show resolved Hide resolved
@kevmoo kevmoo requested a review from munificent November 28, 2023 23:42
Copy link
Member

@munificent munificent left a 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?

@kevmoo kevmoo marked this pull request as draft December 1, 2023 18:15
@kevmoo kevmoo marked this pull request as ready for review December 6, 2023 00:42
@kevmoo kevmoo merged commit 6249194 into main Dec 6, 2023
7 checks passed
@kevmoo kevmoo deleted the latest_lints branch December 6, 2023 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants