ruff/crates
Joffrey Bluthé 578ddf1bb1
[isort] Add support for length-sort settings (#8841)
## 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
2023-11-28 06:00:37 +00:00
..
flake8_to_ruff Bump configparser from 3.0.2 to 3.0.3 (#8849) 2023-11-27 10:07:22 +00:00
ruff_benchmark Bump codspeed-criterion-compat from 2.3.1 to 2.3.3 (#8784) 2023-11-20 11:10:48 +00:00
ruff_cache Update to Rust 1.74 and use new clippy lints table (#8722) 2023-11-16 18:12:46 -05:00
ruff_cli Factor out a builder to handle common integration test arguments (#8733) 2023-11-22 00:32:01 +00:00
ruff_dev Update to Rust 1.74 and use new clippy lints table (#8722) 2023-11-16 18:12:46 -05:00
ruff_diagnostics Update applicability messages for clarity in tests (#8541) 2023-11-07 16:11:43 +00:00
ruff_formatter Update to Rust 1.74 and use new clippy lints table (#8722) 2023-11-16 18:12:46 -05:00
ruff_index Update to Rust 1.74 and use new clippy lints table (#8722) 2023-11-16 18:12:46 -05:00
ruff_linter [isort] Add support for length-sort settings (#8841) 2023-11-28 06:00:37 +00:00
ruff_macros Update to Rust 1.74 and use new clippy lints table (#8722) 2023-11-16 18:12:46 -05:00
ruff_notebook Avoid B015,B018 for last expression in a cell (#8815) 2023-11-22 15:33:23 +00:00
ruff_python_ast Remove #[allow(unused_variables)] from visitor methods (#8828) 2023-11-25 00:09:46 +00:00
ruff_python_codegen Update string nodes for implicit concatenation (#7927) 2023-11-24 17:55:41 -06:00
ruff_python_formatter ruff_python_formatter: move docstring handling to a submodule (#8861) 2023-11-27 13:32:26 -05:00
ruff_python_index Update to Rust 1.74 and use new clippy lints table (#8722) 2023-11-16 18:12:46 -05:00
ruff_python_literal Update to Rust 1.74 and use new clippy lints table (#8722) 2023-11-16 18:12:46 -05:00
ruff_python_parser Update string nodes for implicit concatenation (#7927) 2023-11-24 17:55:41 -06:00
ruff_python_resolver Update to Rust 1.74 and use new clippy lints table (#8722) 2023-11-16 18:12:46 -05:00
ruff_python_semantic Update to Rust 1.74 and use new clippy lints table (#8722) 2023-11-16 18:12:46 -05:00
ruff_python_stdlib Update to Rust 1.74 and use new clippy lints table (#8722) 2023-11-16 18:12:46 -05:00
ruff_python_trivia Update to Rust 1.74 and use new clippy lints table (#8722) 2023-11-16 18:12:46 -05:00
ruff_shrinking Bump version to v0.1.6 (#8744) 2023-11-17 13:29:19 -05:00
ruff_source_file Update to Rust 1.74 and use new clippy lints table (#8722) 2023-11-16 18:12:46 -05:00
ruff_text_size Update to Rust 1.74 and use new clippy lints table (#8722) 2023-11-16 18:12:46 -05:00
ruff_wasm Bump wasm-bindgen-test from 0.3.37 to 0.3.38 (#8847) 2023-11-27 10:02:53 +00:00
ruff_workspace [isort] Add support for length-sort settings (#8841) 2023-11-28 06:00:37 +00:00