ruff icon indicating copy to clipboard operation
ruff copied to clipboard

Feature Request: Ruff doesn't support expanding star imports

Open code-yeongyu opened this issue 2 years ago • 2 comments

I would like to say first that I feel amazing about your product and think it's super awesome and useful. I was surprised by the speed of Ruff and cannot go back to the past without using it.

I noticed that Ruff does not currently support the option to expand star imports. This feature is mentioned in the benchmark code that compares Ruff with autoflake. It would be great if this feature could be added to Ruff in the future.

Thanks.

code-yeongyu avatar Dec 30 '22 02:12 code-yeongyu

Thank you, that's awesome to hear :)

charliermarsh avatar Dec 30 '22 02:12 charliermarsh

I agree, we should support this.

It looks like autoflake only allow this when you have a single star import (and it basically just imports everything that's undefined from that module). We should be able to support that behavior. It'd be nice to do even better (e.g., detect which module each undefined name came from)... but parity is not too hard.

charliermarsh avatar Dec 30 '22 02:12 charliermarsh

On further reflection, I'd like to pass on this one for now. I understand why it's useful, but the rate of false positives seems really high given the autoflake strategy.

charliermarsh avatar Jan 15 '23 07:01 charliermarsh