-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
support no_sections option for isort #8653
Labels
isort
Related to import sorting
Comments
I don't believe we support this today. |
FWIW I'm trying to come up with a PR for this. |
jelmer
added a commit
to jelmer/ruff
that referenced
this issue
Nov 13, 2023
This is similar to what exists in upstream isort. Fixes astral-sh#8653
jelmer
added a commit
to jelmer/ruff
that referenced
this issue
Nov 13, 2023
This is similar to what exists in upstream isort. Fixes astral-sh#8653
jelmer
added a commit
to jelmer/ruff
that referenced
this issue
Nov 13, 2023
This is similar to what exists in upstream isort. Fixes astral-sh#8653
jelmer
added a commit
to jelmer/ruff
that referenced
this issue
Nov 14, 2023
This is similar to what exists in upstream isort. Fixes astral-sh#8653
charliermarsh
pushed a commit
that referenced
this issue
Nov 14, 2023
## Summary This adds a ``no-sections`` option for isort in the linter, similar to the ``no_sections`` option that exists in upstream isort (https://pycqa.github.io/isort/docs/configuration/options.html#no-sections) This option puts all imports except for ``__future__`` into the same section, and is mostly used by monorepos. I've taken a bit of a leap in assuming that ruff wants to support the exact same option; more than happy to refactor if you'd prefer a different way of setting this up. Fixes #8653 ## Test Plan I've added a test and have run it on a large Python codebase that uses isort with --no-sections. The option is disabled by default.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ruff's isort doesn't support the
no_sections
option that isort upstream has. This option puts all import sinto the same import bucket.For example, consider this source file:
isort --no-sections x.py format it as
As far as I can tell, there is no set of options for ruff's isort that provides this behaviour (if there is and I've missed it, I'll volunteer to add a note to the docs)
The text was updated successfully, but these errors were encountered: