Skip to content

fix for omit_local_variable_types can leave unused imports #43887

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

Closed
pq opened this issue Oct 22, 2020 · 3 comments
Closed

fix for omit_local_variable_types can leave unused imports #43887

pq opened this issue Oct 22, 2020 · 3 comments
Labels
devexp-bulk-fix devexp-quick-fix Issues with analysis server (quick) fixes devexp-ux legacy-area-analyzer Use area-devexp instead. P4

Comments

@pq
Copy link
Member

pq commented Oct 22, 2020

Any fix that removes a type reference (or API call) might leave dead imports.

We might consider removing the (newly) unneeded import when performing the fix.

This is especially impacting in applying bulk fixes.

Related to: #43886.

@pq pq added legacy-area-analyzer Use area-devexp instead. devexp-quick-fix Issues with analysis server (quick) fixes devexp-bulk-fix labels Oct 22, 2020
@pq pq added the devexp-ux label Oct 22, 2020
@srawlins srawlins added the P4 label Nov 10, 2020
@srawlins
Copy link
Member

With so many lints and so many fixes (I love it), I think a more general solution might be needed.

  1. Would it be too crazy to repeatedly fix until stability is reached? In round one, a type might be removed; in round two an import might be removed; in round three a pub dependency might be removed.
  2. Are there not too many rules that a fix might trigger? unused_xyz, unnecessary_xyz? A second round could be triggered that just fixes those.

@bwilkerson
Copy link
Member

I had forgotten about (or never known about) this issue. The dart fix tool has already been updated to do just the kind of iteration you suggested. I'm going to close this issue with the assumption that there isn't any additional work required.

@srawlins
Copy link
Member

That's excellent, I had no idea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devexp-bulk-fix devexp-quick-fix Issues with analysis server (quick) fixes devexp-ux legacy-area-analyzer Use area-devexp instead. P4
Projects
None yet
Development

No branches or pull requests

3 participants