mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 05:15:12 +00:00
nit: docs for ignore & select (#15883)
This commit is contained in:
parent
de4d9979eb
commit
b848afeae8
3 changed files with 11 additions and 8 deletions
|
@ -18,7 +18,8 @@ fn lint_select() {
|
||||||
|
|
||||||
When breaking ties between enabled and disabled rules (via `select` and
|
When breaking ties between enabled and disabled rules (via `select` and
|
||||||
`ignore`, respectively), more specific prefixes override less
|
`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"]
|
Default value: ["E4", "E7", "E9", "F"]
|
||||||
Type: list[RuleSelector]
|
Type: list[RuleSelector]
|
||||||
|
@ -41,7 +42,7 @@ fn lint_select_json() {
|
||||||
exit_code: 0
|
exit_code: 0
|
||||||
----- stdout -----
|
----- 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\"]",
|
"default": "[\"E4\", \"E7\", \"E9\", \"F\"]",
|
||||||
"value_type": "list[RuleSelector]",
|
"value_type": "list[RuleSelector]",
|
||||||
"scope": null,
|
"scope": null,
|
||||||
|
|
|
@ -656,7 +656,8 @@ pub struct LintCommonOptions {
|
||||||
///
|
///
|
||||||
/// When breaking ties between enabled and disabled rules (via `select` and
|
/// When breaking ties between enabled and disabled rules (via `select` and
|
||||||
/// `ignore`, respectively), more specific prefixes override less
|
/// `ignore`, respectively), more specific prefixes override less
|
||||||
/// specific prefixes.
|
/// specific prefixes. `ignore` takes precedence over `select` if the same
|
||||||
|
/// prefix appears in both.
|
||||||
#[option(
|
#[option(
|
||||||
default = "[]",
|
default = "[]",
|
||||||
value_type = "list[RuleSelector]",
|
value_type = "list[RuleSelector]",
|
||||||
|
@ -742,7 +743,8 @@ pub struct LintCommonOptions {
|
||||||
///
|
///
|
||||||
/// When breaking ties between enabled and disabled rules (via `select` and
|
/// When breaking ties between enabled and disabled rules (via `select` and
|
||||||
/// `ignore`, respectively), more specific prefixes override less
|
/// `ignore`, respectively), more specific prefixes override less
|
||||||
/// specific prefixes.
|
/// specific prefixes. `ignore` takes precedence over `select` if the
|
||||||
|
/// same prefix appears in both.
|
||||||
#[option(
|
#[option(
|
||||||
default = r#"["E4", "E7", "E9", "F"]"#,
|
default = r#"["E4", "E7", "E9", "F"]"#,
|
||||||
value_type = "list[RuleSelector]",
|
value_type = "list[RuleSelector]",
|
||||||
|
|
8
ruff.schema.json
generated
8
ruff.schema.json
generated
|
@ -436,7 +436,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"ignore": {
|
"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,
|
"deprecated": true,
|
||||||
"type": [
|
"type": [
|
||||||
"array",
|
"array",
|
||||||
|
@ -664,7 +664,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"select": {
|
"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,
|
"deprecated": true,
|
||||||
"type": [
|
"type": [
|
||||||
"array",
|
"array",
|
||||||
|
@ -2223,7 +2223,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"ignore": {
|
"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": [
|
"type": [
|
||||||
"array",
|
"array",
|
||||||
"null"
|
"null"
|
||||||
|
@ -2381,7 +2381,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"select": {
|
"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": [
|
"type": [
|
||||||
"array",
|
"array",
|
||||||
"null"
|
"null"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue