From 9cdb0d7e7ad18c4b79f44b9462e194315b9729a3 Mon Sep 17 00:00:00 2001 From: chiri Date: Thu, 30 Oct 2025 12:48:31 +0300 Subject: [PATCH 1/3] update extend doc --- crates/ruff_workspace/src/options.rs | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/crates/ruff_workspace/src/options.rs b/crates/ruff_workspace/src/options.rs index 47ee0fe738ddd..fe3c7a2282ef5 100644 --- a/crates/ruff_workspace/src/options.rs +++ b/crates/ruff_workspace/src/options.rs @@ -59,13 +59,29 @@ pub struct Options { )] pub cache_dir: Option, - /// A path to a local `pyproject.toml` file to merge into this + /// A path to a local `pyproject.toml` or `ruff.toml` file to merge into this /// configuration. User home directory and environment variables will be /// expanded. /// - /// To resolve the current `pyproject.toml` file, Ruff will first resolve - /// this base configuration file, then merge in any properties defined - /// in the current configuration file. + /// To resolve the current configuration file, Ruff will first load + /// this base configuration file, then merge in properties defined + /// in the current configuration file. Most settings follow simple override + /// behavior where the child value replaces the parent value. However, + /// rule selection (`lint.select` and `lint.ignore`) has special merging + /// behavior: if the child configuration specifies `lint.select`, it + /// establishes a new baseline rule set and the parent's `lint.ignore` + /// rules are discarded; if the child configuration omits `lint.select`, + /// the parent's rule selection is inherited and both parent and child + /// `lint.ignore` rules are accumulated together. + /// + /// When multiple configuration sources are present, Ruff uses the + /// "highest-priority" `select` as the basis for the rule set, then applies + /// `extend-select` and `ignore` adjustments. CLI options are given higher + /// priority than configuration file options, and the current configuration + /// file is given higher priority than any extended parent configuration. + /// However, this priority model only applies when `lint.select` is explicitly + /// specified in the higher-priority source; without an explicit `select`, + /// `ignore` rules accumulate rather than override. #[option( default = r#"null"#, value_type = "str", From bab3be72ed50b26e7eae6479c218f85d1d5cee4a Mon Sep 17 00:00:00 2001 From: chiri Date: Thu, 30 Oct 2025 12:59:18 +0300 Subject: [PATCH 2/3] update ruff schema --- ruff.schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruff.schema.json b/ruff.schema.json index 04ef3fcc3df33..f1dc57ed88248 100644 --- a/ruff.schema.json +++ b/ruff.schema.json @@ -71,7 +71,7 @@ "deprecated": true }, "extend": { - "description": "A path to a local `pyproject.toml` file to merge into this\nconfiguration. User home directory and environment variables will be\nexpanded.\n\nTo resolve the current `pyproject.toml` file, Ruff will first resolve\nthis base configuration file, then merge in any properties defined\nin the current configuration file.", + "description": "A path to a local `pyproject.toml` or `ruff.toml` file to merge into this\nconfiguration. User home directory and environment variables will be\nexpanded.\n\nTo resolve the current configuration file, Ruff will first load\nthis base configuration file, then merge in properties defined\nin the current configuration file. Most settings follow simple override\nbehavior where the child value replaces the parent value. However,\nrule selection (`lint.select` and `lint.ignore`) has special merging\nbehavior: if the child configuration specifies `lint.select`, it\nestablishes a new baseline rule set and the parent's `lint.ignore`\nrules are discarded; if the child configuration omits `lint.select`,\nthe parent's rule selection is inherited and both parent and child\n`lint.ignore` rules are accumulated together.\n\nWhen multiple configuration sources are present, Ruff uses the\n\"highest-priority\" `select` as the basis for the rule set, then applies\n`extend-select` and `ignore` adjustments. CLI options are given higher\npriority than configuration file options, and the current configuration\nfile is given higher priority than any extended parent configuration.\nHowever, this priority model only applies when `lint.select` is explicitly\nspecified in the higher-priority source; without an explicit `select`,\n`ignore` rules accumulate rather than override.", "type": [ "string", "null" From c76405303c1673a3ae7c20397d10505d0f9a0a87 Mon Sep 17 00:00:00 2001 From: Micha Reiser Date: Fri, 31 Oct 2025 08:59:05 -0400 Subject: [PATCH 3/3] Refine --- crates/ruff_workspace/src/options.rs | 9 --------- ruff.schema.json | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/crates/ruff_workspace/src/options.rs b/crates/ruff_workspace/src/options.rs index fe3c7a2282ef5..708d6dcf0bdbf 100644 --- a/crates/ruff_workspace/src/options.rs +++ b/crates/ruff_workspace/src/options.rs @@ -73,15 +73,6 @@ pub struct Options { /// rules are discarded; if the child configuration omits `lint.select`, /// the parent's rule selection is inherited and both parent and child /// `lint.ignore` rules are accumulated together. - /// - /// When multiple configuration sources are present, Ruff uses the - /// "highest-priority" `select` as the basis for the rule set, then applies - /// `extend-select` and `ignore` adjustments. CLI options are given higher - /// priority than configuration file options, and the current configuration - /// file is given higher priority than any extended parent configuration. - /// However, this priority model only applies when `lint.select` is explicitly - /// specified in the higher-priority source; without an explicit `select`, - /// `ignore` rules accumulate rather than override. #[option( default = r#"null"#, value_type = "str", diff --git a/ruff.schema.json b/ruff.schema.json index f1dc57ed88248..a16e91fbd7ed8 100644 --- a/ruff.schema.json +++ b/ruff.schema.json @@ -71,7 +71,7 @@ "deprecated": true }, "extend": { - "description": "A path to a local `pyproject.toml` or `ruff.toml` file to merge into this\nconfiguration. User home directory and environment variables will be\nexpanded.\n\nTo resolve the current configuration file, Ruff will first load\nthis base configuration file, then merge in properties defined\nin the current configuration file. Most settings follow simple override\nbehavior where the child value replaces the parent value. However,\nrule selection (`lint.select` and `lint.ignore`) has special merging\nbehavior: if the child configuration specifies `lint.select`, it\nestablishes a new baseline rule set and the parent's `lint.ignore`\nrules are discarded; if the child configuration omits `lint.select`,\nthe parent's rule selection is inherited and both parent and child\n`lint.ignore` rules are accumulated together.\n\nWhen multiple configuration sources are present, Ruff uses the\n\"highest-priority\" `select` as the basis for the rule set, then applies\n`extend-select` and `ignore` adjustments. CLI options are given higher\npriority than configuration file options, and the current configuration\nfile is given higher priority than any extended parent configuration.\nHowever, this priority model only applies when `lint.select` is explicitly\nspecified in the higher-priority source; without an explicit `select`,\n`ignore` rules accumulate rather than override.", + "description": "A path to a local `pyproject.toml` or `ruff.toml` file to merge into this\nconfiguration. User home directory and environment variables will be\nexpanded.\n\nTo resolve the current configuration file, Ruff will first load\nthis base configuration file, then merge in properties defined\nin the current configuration file. Most settings follow simple override\nbehavior where the child value replaces the parent value. However,\nrule selection (`lint.select` and `lint.ignore`) has special merging\nbehavior: if the child configuration specifies `lint.select`, it\nestablishes a new baseline rule set and the parent's `lint.ignore`\nrules are discarded; if the child configuration omits `lint.select`,\nthe parent's rule selection is inherited and both parent and child\n`lint.ignore` rules are accumulated together.", "type": [ "string", "null"