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
isort clash with ruff I001 when module has digit #6043
Comments
Hah interesting |
I'm trying to understand why isort would use that ordering. It's strange because (e.g.) |
Related discussion at PyCQA/isort#1732 and implementation at https://github.com/PyCQA/isort/blob/615de51b1955d0b41e45de15081e20f03b3b708d/isort/sorting.py#L111-L130 |
Ahhh thank you, so helpful. My gut reaction is that this looks like an unintended behavior in isort... They're trying to ensure that they respect this: from geln_olga2.models import Data
from geln_olga10.models import Data But that's leading them to put numbers before non-numerical suffixes. Ruff seems to do the right thing -- it respects this: from geln_olga2.models import Data
from geln_olga10.models import Data But also this: from geln_olga.models import Data
from geln_olga2.models import Data |
I think I'm gonna close with the understanding that we do deviate from upstream when we feel that our behavior represents a bug fix. |
isort sorts imports in a way that induces ruff to flag
I001
, aka ruff and isort want to sort the imports in different ways (I suspect when module has a number in name).after running isort
then
after running ruff auto-correct (which I only apply manually to see the difference)
Relevant settings are:
.pre-commit-config.yaml
The text was updated successfully, but these errors were encountered: