hakancelikdev / unimport

:rocket: The ultimate linter and formatter for removing unused import statements in your code.
https://unimport.hakancelik.dev/
MIT License
239 stars 22 forks source link

Fail to remove `import matplotlib.pyplot as plt` #284

Closed ThomasParistech closed 1 year ago

ThomasParistech commented 1 year ago

Thanks for the great lib.

However when I run the command unimport $(find . -name '*.py') --remove, it always fails to remove unused import matplotlib.pyplot as plt.

This is the only bug that I've noticed, but It happens systematically with this import.

Any idea ?

I'm using unimport==0.14.1.

Many thanks

hakancelikdev commented 1 year ago

Thanks for your kind words I am thrilled to hear that! and thanks you open the issue,

This problem occurs when your import type is as follows, I will solve it as soon as possible, in addition, in the new version of unimport, you no longer need to use the --remove flag, --remove is now the default.

import a.b as x

hakancelikdev commented 1 year ago

Can you try again, after installing https://pypi.org/project/unimport/0.15.0/

ThomasParistech commented 1 year ago

Can you try again, after installing https://pypi.org/project/unimport/0.15.0/

It works, many thanks :pray: