-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Migrating analyzer_plugin to null safety #45236
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
Comments
Thanks for the inquiry; there aren't currently plans to migrate it to null safety (and no plans not to, it's just that getting package:analyzer null safe was a larger priority). A contribution would be welcome; if you haven't contributed through the dart-lang/sdk process before, you'll want to take a look at https://github.com/dart-lang/sdk/blob/master/CONTRIBUTING.md. |
We are not working yet on migrating As far as I can see, almost all dependencies of |
I have already started working on the migration (using Although all dependencies seems to have null safe version, I have a problem with resolving both |
I have not tried exactly this, but you might need to use dependency overrides while working on this. |
Oh, will try, thanks! |
So yeah, I was doing it wrong and there is no need to call I have two main questions:
I actually don't know if it's the right place to ask questions. If it's not, do you have a place where I can ask them? |
Ask any question here. If there are any fields that have non-nullable type, but the comment says that they are nullable, please tell us about these fields. This most probably means that I did not update the comment. It is fine if the generating tool looks too complicated for you, I can do this portion a bit later. |
Thanks for the quick response! Three places so far: first, second, third. As for generating tool - I will take a look at it once more, but if I decide to leave it, should I revert changes to generated files? And it seems that migration is kinda huge (like ~85 changed files or so). How can I help you to review it (I can split it to a commit per file or group several files to a commit)? |
If you mean migrating the code in the generator, then we ought to be able to do that separately. If you mean update the generator to produce null safe code, that might be necessary, even if it's just to add a
No. Those packages depend on the |
Yeah, I meant produced code. But won't a
Oh, thats great. |
Thank you, I will update these comments. Whatever is easier for you - if you have already done migrating the generated code, keep it. The generator itself is not a production code, so it will not prevent tests or clients from being null safe. |
It shouldn't prevent it. The semantics of writing null safe code that depends on un-migrated code are well defined, and it shouldn't be a requirement to migrate all dependent packages first, but it is strongly advised for two reasons:
So I think it would be reasonable to update the generator to generate those comments and then let someone else update the generator and regenerate the code before we publish the package.
@scheglov Won't |
Yes, the check for generator will fail, we would have to disable it for a short time while we are working on migrating the generator. |
#45236 (comment) Change-Id: Ic9aa0b120cb0796ad1796c6f34aef8fc5360700a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191481 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
Great, I will remove null checks for those cases then.
Oh, thanks for clarifying that. Am I correct, that if we assume that users of the Here is the PR link https://dart-review.googlesource.com/c/sdk/+/191622 |
Should I disable checks for generator by myself? And do I need to update package version in pubspec? And is it intentional that |
Could you please help with the next step after getting |
Bug: #45236 Change-Id: I01175a2b2b1eb3ce6cdf30ade794d8186c6e8ead Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191622 Reviewed-by: Konstantin Shcheglov <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
Null safe |
Thank you very much for helping me with the CL! |
Thanks for doing all the work to migrate it! |
Hi, it seems that there is a small problem with null safety migration. If it's more appropriate, I can create a separate issue for that. |
Published and landed. |
Change-Id: Ibffb027251f1a6033e80f09dc1cb130d34262c70 Bug: #45236 (comment) Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194542 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
Thank you! Works like a charm. |
Hi, are there any plans for migrating analyzer_plugin to null safety? Our package depends on it and we want to start migration too. I'd be happy to open a PR for analyzer_plugin null safety migration if it isn't already in the works.
The text was updated successfully, but these errors were encountered: