1
3
mirror of https://github.com/charliermarsh/ruff synced 2025-10-05 15:42:51 +02:00

[isort] Clarify dependency between order-by-type and case-sensitive settings (#20559)

Summary
--

Fixes #20536 by linking between the isort options `case-sensitive` and
`order-by-type`. The latter takes precedence over the former, so it
seems good to clarify this somewhere.

I tweaked the wording slightly, but this is otherwise based on the patch
from @SkylerWittman in
https://github.com/astral-sh/ruff/issues/20536#issuecomment-3326097324
(thank you!)

Test Plan
--

N/a

---------

Co-authored-by: Skyler Wittman <skyler.wittman@gmail.com>
Co-authored-by: Micha Reiser <micha@reiser.io>
This commit is contained in:
Brent Westbrook
2025-09-25 12:25:12 -04:00
committed by GitHub
parent 9903104328
commit 6b7a9dc2f2
2 changed files with 8 additions and 2 deletions

View File

@@ -2302,6 +2302,9 @@ pub struct IsortOptions {
/// Order imports by type, which is determined by case, in addition to
/// alphabetically.
///
/// Note that this option takes precedence over the
/// [`case-sensitive`](#lint_isort_case-sensitive) setting when enabled.
#[option(
default = r#"true"#,
value_type = "bool",
@@ -2324,6 +2327,9 @@ pub struct IsortOptions {
pub force_sort_within_sections: Option<bool>,
/// Sort imports taking into account case sensitivity.
///
/// Note that the [`order-by-type`](#lint_isort_order-by-type) setting will
/// take precedence over this one when enabled.
#[option(
default = r#"false"#,
value_type = "bool",

4
ruff.schema.json generated
View File

@@ -1655,7 +1655,7 @@
"type": "object",
"properties": {
"case-sensitive": {
"description": "Sort imports taking into account case sensitivity.",
"description": "Sort imports taking into account case sensitivity.\n\nNote that the [`order-by-type`](#lint_isort_order-by-type) setting will take precedence over this one when enabled.",
"type": [
"boolean",
"null"
@@ -1843,7 +1843,7 @@
]
},
"order-by-type": {
"description": "Order imports by type, which is determined by case, in addition to alphabetically.",
"description": "Order imports by type, which is determined by case, in addition to alphabetically.\n\nNote that this option takes precedence over the [`case-sensitive`](#lint_isort_case-sensitive) setting when enabled.",
"type": [
"boolean",
"null"