ruff
ruff copied to clipboard
Ruff is removing used imports
Removing used imports (probably wrong classified as "unused"
ruff check . --fix --verbose
ruff format --verbose
Here is autoformat configured with commands above:
here is a function that is using the import:
The ruff format insists in remove used import, it was not first time, but now it is first time it was doing several times in a row.
Can you please include a full reproducible example, like a Python file that demonstrates the bug? That snippet alone isn’t enough (and can’t be copy-pasted) since it doesn’t contain any imports.
Might be a duplicate of https://github.com/astral-sh/ruff/issues/8691
Closing as a dupe, looks that way.
I think it's actually slightly different than #8691.