Skip to content

isort options for profile compatibility #24323

@MichaReiser

Description

@MichaReiser

Discussed in #24315

Originally posted by tonycoco March 30, 2026
Since my attempt at a single config option addition to the isort capabilities here #24313 was closed, I wanted to discuss adding isort's lexicographical config option to ruff. As stated in an original PR (#22572) to bring ruff to parity with isort's profile options, I'm trying to move a few open-source Google repos to use ruff and this would be a helpful option to switch. A fully "google" profile compatible config for ruff would look something like:

[tool.ruff.lint.isort]
lexicographical = true # Not yet implemented
line-length = 1000 # Not yet implemented
group-by-package = true # Not yet implemented
force-single-line = true
force-sort-within-sections = true
single-line-exclusions = [
  "collections.abc",
  "six.moves",
  "typing",
  "typing-extensions"
]
order-by-type = false

A potential PR is working here to tackle the lexicographical option: https://github.com/tonycoco/ruff/tree/isort-lexicographical and I'm happy to re-open and share more.

Related to #3119

Metadata

Metadata

Assignees

No one assigned

    Labels

    isortRelated to import sortingneeds-designNeeds further design before implementation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions