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:
@@ -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
4
ruff.schema.json
generated
@@ -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"
|
||||
|
Reference in New Issue
Block a user