ruff/crates/ruff_linter
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
..
resources/test [isort] Add support for length-sort settings (#8841) 2023-11-28 06:00:37 +00:00
src [isort] Add support for length-sort settings (#8841) 2023-11-28 06:00:37 +00:00
Cargo.toml Bump version to v0.1.6 (#8744) 2023-11-17 13:29:19 -05:00