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

Bump to analyzer 5.1.0 and handle deprecations #1140

Merged
merged 3 commits into from
Oct 3, 2022
Merged

Conversation

srawlins
Copy link
Member

Since one of the deprecations is moving .name2 back to .name, I think it's necessary to bump the lower bound. In analyzer 4.4.0, .name may have meant a different thing...

In any case, analyzer 5.1.0 is the first release to allow unnamed libraries, so I think it is necessary for the follow up PR which adds such support in dart_style.

@srawlins
Copy link
Member Author

I think test and analyzer 5.0.0 have some pub version solve issue, so that effectively, analyzer 5.0.0 paired with package:test are only supported on Dart 2.18.0. Should I change the GitHub actions to handle this? (As it is, I guess we're now testing 2.17.0 and 2.19.0-dev.)

@srawlins
Copy link
Member Author

I've merged in a bump to the GitHub actions, combining #1142 with this. Good talk.

@srawlins
Copy link
Member Author

This is a preliminary step to #1141

PTAL @munificent @natebosch

@@ -2022,7 +2022,7 @@ class SourceVisitor extends ThrowingAstVisitor {
_simpleStatement(node, () {
token(node.libraryKeyword);
space();
visit(node.name);
visit(node.name2);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's happening with this one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In analyzer 5.1.0, .name is deprecated in favor of .name2.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this on a different type than the rest of the invocations?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, my bad. In all of the other changes, .name2 is deprecated in favor of .name.

For this change, LibraryDirective.name, a non-nullable String is being replaced with LibraryDirective.name2, a nullable String (for the case of an omitted named).

@@ -9,7 +9,7 @@ environment:
sdk: ">=2.17.0 <3.0.0"

dependencies:
analyzer: '>=4.4.0 <6.0.0'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't leave a comment on the right line - but we need to bump the version of dart_style

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Member

@natebosch natebosch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked up the relevant APIs... It feels weird that on some nodes we're flipping one way, and on other nodes the opposite way... 🤷

@srawlins
Copy link
Member Author

srawlins commented Oct 1, 2022

Yeah that is definitely a weird situation in this release. Accidental on my and Konstantin's part.

@munificent munificent merged commit 1510c99 into master Oct 3, 2022
@munificent munificent deleted the analyzer-5-1-0 branch October 3, 2022 23:45
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.

3 participants