mirror of
https://github.com/astral-sh/ruff
synced 2026-01-21 05:20:49 -05:00
## Summary When `relative-imports-order = "closest-to-furthest"` is set, we should _still_ put non-relative imports after relative imports. It's rare for them to be in the same section, but _possible_ if you use `known-local-folder`. Closes https://github.com/astral-sh/ruff/issues/10655. ## Test Plan New tests. Also sorted this file: ```python from ..models import ABC from .models import Question from .utils import create_question from django_polls.apps.polls.models import Choice ``` With both: - `isort view.py` - `ruff check view.py --select I --fix` And the following `pyproject.toml`: ```toml [tool.ruff.lint.isort] order-by-type = false relative-imports-order = "closest-to-furthest" known-local-folder = ["django_polls"] [tool.isort] profile = "black" reverse_relative = true known_local_folder = ["django_polls"] ``` I verified that Ruff and isort gave the same result, and that they _still_ gave the same result when removing the relevant setting: ```toml [tool.ruff.lint.isort] order-by-type = false known-local-folder = ["django_polls"] [tool.isort] profile = "black" known_local_folder = ["django_polls"] ```