From 6b7a9dc2f29b2d8565c32c22189295049e3814a8 Mon Sep 17 00:00:00 2001 From: Brent Westbrook <36778786+ntBre@users.noreply.github.com> Date: Thu, 25 Sep 2025 12:25:12 -0400 Subject: [PATCH] [`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 Co-authored-by: Micha Reiser --- crates/ruff_workspace/src/options.rs | 6 ++++++ ruff.schema.json | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/ruff_workspace/src/options.rs b/crates/ruff_workspace/src/options.rs index 03d97a0a04..055291b53c 100644 --- a/crates/ruff_workspace/src/options.rs +++ b/crates/ruff_workspace/src/options.rs @@ -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, /// 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", diff --git a/ruff.schema.json b/ruff.schema.json index 3b1e4da9d3..219f6b46e6 100644 --- a/ruff.schema.json +++ b/ruff.schema.json @@ -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"