mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-02 09:52:18 +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 |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |