mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 13:25:17 +00:00
Match rule prefixes from external
codes setting in unused-noqa
(#8177)
Supersedes https://github.com/astral-sh/ruff/pull/8176 Closes https://github.com/astral-sh/ruff/pull/8174 ## Test plan Old snapshot contains the new / unmatched `V` code New snapshot contains no `V` prefixed codes
This commit is contained in:
parent
a6cc56fd98
commit
6f31e9c00e
9 changed files with 426 additions and 115 deletions
|
@ -548,7 +548,7 @@ pub struct LintCommonOptions {
|
|||
)]
|
||||
pub extend_unfixable: Option<Vec<RuleSelector>>,
|
||||
|
||||
/// A list of rule codes that are unsupported by Ruff, but should be
|
||||
/// A list of rule codes or prefixes that are unsupported by Ruff, but should be
|
||||
/// preserved when (e.g.) validating `# noqa` directives. Useful for
|
||||
/// retaining `# noqa` directives that cover plugins not yet implemented
|
||||
/// by Ruff.
|
||||
|
@ -556,9 +556,9 @@ pub struct LintCommonOptions {
|
|||
default = "[]",
|
||||
value_type = "list[str]",
|
||||
example = r#"
|
||||
# Avoiding flagging (and removing) `V101` from any `# noqa`
|
||||
# directives, despite Ruff's lack of support for `vulture`.
|
||||
external = ["V101"]
|
||||
# Avoiding flagging (and removing) any codes starting with `V` from any
|
||||
# `# noqa` directives, despite Ruff's lack of support for `vulture`.
|
||||
external = ["V"]
|
||||
"#
|
||||
)]
|
||||
pub external: Option<Vec<String>>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue