Open tpgillam opened 2 hours ago
Interesting... I think this is not quite what ICN001 was designed for. It's not possible to import (and then alias) a function like import mymodule.myfunction
, which is what your user configuration is asking ICN001 to do.
Were you maybe looking for something like ICN003
?
I obtain errors with ICN001 when trying to apply autofix (in 'unsafe' mode) that should ideally convert the import from
from A1.A2.AN import B
toimport A1.A2.AN
.For example, consider the following simple source file
moo.py
:And then the following configuration for ruff in
pyproject.toml
I get the following error:
I'm not 100% sure that I'm not abusing the intention of this rule, since here I'm trying to use the rule to enforce the absence of an alias, rather than a conventional alias :)