diff --git a/crates/ruff/tests/config.rs b/crates/ruff/tests/config.rs index 9447a9a643..7ef338f68c 100644 --- a/crates/ruff/tests/config.rs +++ b/crates/ruff/tests/config.rs @@ -18,7 +18,8 @@ fn lint_select() { When breaking ties between enabled and disabled rules (via `select` and `ignore`, respectively), more specific prefixes override less - specific prefixes. + specific prefixes. `ignore` takes precedence over `select` if the + same prefix appears in both. Default value: ["E4", "E7", "E9", "F"] Type: list[RuleSelector] @@ -41,7 +42,7 @@ fn lint_select_json() { exit_code: 0 ----- stdout ----- { - "doc": "A list of rule codes or prefixes to enable. Prefixes can specify exact\nrules (like `F841`), entire categories (like `F`), or anything in\nbetween.\n\nWhen breaking ties between enabled and disabled rules (via `select` and\n`ignore`, respectively), more specific prefixes override less\nspecific prefixes.", + "doc": "A list of rule codes or prefixes to enable. Prefixes can specify exact\nrules (like `F841`), entire categories (like `F`), or anything in\nbetween.\n\nWhen breaking ties between enabled and disabled rules (via `select` and\n`ignore`, respectively), more specific prefixes override less\nspecific prefixes. `ignore` takes precedence over `select` if the\nsame prefix appears in both.", "default": "[\"E4\", \"E7\", \"E9\", \"F\"]", "value_type": "list[RuleSelector]", "scope": null, diff --git a/crates/ruff_workspace/src/options.rs b/crates/ruff_workspace/src/options.rs index 2e1c723b4d..058e3dbbe9 100644 --- a/crates/ruff_workspace/src/options.rs +++ b/crates/ruff_workspace/src/options.rs @@ -656,7 +656,8 @@ pub struct LintCommonOptions { /// /// When breaking ties between enabled and disabled rules (via `select` and /// `ignore`, respectively), more specific prefixes override less - /// specific prefixes. + /// specific prefixes. `ignore` takes precedence over `select` if the same + /// prefix appears in both. #[option( default = "[]", value_type = "list[RuleSelector]", @@ -742,7 +743,8 @@ pub struct LintCommonOptions { /// /// When breaking ties between enabled and disabled rules (via `select` and /// `ignore`, respectively), more specific prefixes override less - /// specific prefixes. + /// specific prefixes. `ignore` takes precedence over `select` if the + /// same prefix appears in both. #[option( default = r#"["E4", "E7", "E9", "F"]"#, value_type = "list[RuleSelector]", diff --git a/ruff.schema.json b/ruff.schema.json index aee5b2d58b..48042711f2 100644 --- a/ruff.schema.json +++ b/ruff.schema.json @@ -436,7 +436,7 @@ ] }, "ignore": { - "description": "A list of rule codes or prefixes to ignore. Prefixes can specify exact rules (like `F841`), entire categories (like `F`), or anything in between.\n\nWhen breaking ties between enabled and disabled rules (via `select` and `ignore`, respectively), more specific prefixes override less specific prefixes.", + "description": "A list of rule codes or prefixes to ignore. Prefixes can specify exact rules (like `F841`), entire categories (like `F`), or anything in between.\n\nWhen breaking ties between enabled and disabled rules (via `select` and `ignore`, respectively), more specific prefixes override less specific prefixes. `ignore` takes precedence over `select` if the same prefix appears in both.", "deprecated": true, "type": [ "array", @@ -664,7 +664,7 @@ ] }, "select": { - "description": "A list of rule codes or prefixes to enable. Prefixes can specify exact rules (like `F841`), entire categories (like `F`), or anything in between.\n\nWhen breaking ties between enabled and disabled rules (via `select` and `ignore`, respectively), more specific prefixes override less specific prefixes.", + "description": "A list of rule codes or prefixes to enable. Prefixes can specify exact rules (like `F841`), entire categories (like `F`), or anything in between.\n\nWhen breaking ties between enabled and disabled rules (via `select` and `ignore`, respectively), more specific prefixes override less specific prefixes. `ignore` takes precedence over `select` if the same prefix appears in both.", "deprecated": true, "type": [ "array", @@ -2223,7 +2223,7 @@ ] }, "ignore": { - "description": "A list of rule codes or prefixes to ignore. Prefixes can specify exact rules (like `F841`), entire categories (like `F`), or anything in between.\n\nWhen breaking ties between enabled and disabled rules (via `select` and `ignore`, respectively), more specific prefixes override less specific prefixes.", + "description": "A list of rule codes or prefixes to ignore. Prefixes can specify exact rules (like `F841`), entire categories (like `F`), or anything in between.\n\nWhen breaking ties between enabled and disabled rules (via `select` and `ignore`, respectively), more specific prefixes override less specific prefixes. `ignore` takes precedence over `select` if the same prefix appears in both.", "type": [ "array", "null" @@ -2381,7 +2381,7 @@ ] }, "select": { - "description": "A list of rule codes or prefixes to enable. Prefixes can specify exact rules (like `F841`), entire categories (like `F`), or anything in between.\n\nWhen breaking ties between enabled and disabled rules (via `select` and `ignore`, respectively), more specific prefixes override less specific prefixes.", + "description": "A list of rule codes or prefixes to enable. Prefixes can specify exact rules (like `F841`), entire categories (like `F`), or anything in between.\n\nWhen breaking ties between enabled and disabled rules (via `select` and `ignore`, respectively), more specific prefixes override less specific prefixes. `ignore` takes precedence over `select` if the same prefix appears in both.", "type": [ "array", "null"