mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 04:45:01 +00:00
![]() ## Summary Closes #1567. Add both `length-sort` and `length-sort-straight` settings for isort. Here are a few notable points: - The length is determined using the [`unicode_width`](https://crates.io/crates/unicode-width) crate, i.e. we are talking about displayed length (this is explicitly mentioned in the description of the setting) - The dots are taken into account in the length to be compatible with the original isort - I had to reorder a few fields of the module key struct for it all to make sense (notably the `force_to_top` field is now the first one) ## Test Plan I added tests for the following cases: - Basic tests for length-sort with ASCII characters only - Tests with non-ASCII characters - Tests with relative imports - Tests for length-sort-straight |
||
---|---|---|
.. | ||
flake8_to_ruff | ||
ruff_benchmark | ||
ruff_cache | ||
ruff_cli | ||
ruff_dev | ||
ruff_diagnostics | ||
ruff_formatter | ||
ruff_index | ||
ruff_linter | ||
ruff_macros | ||
ruff_notebook | ||
ruff_python_ast | ||
ruff_python_codegen | ||
ruff_python_formatter | ||
ruff_python_index | ||
ruff_python_literal | ||
ruff_python_parser | ||
ruff_python_resolver | ||
ruff_python_semantic | ||
ruff_python_stdlib | ||
ruff_python_trivia | ||
ruff_shrinking | ||
ruff_source_file | ||
ruff_text_size | ||
ruff_wasm | ||
ruff_workspace |