mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-24 13:33:50 +00:00
Add new rule RUF059: Unused unpacked assignment (#16449)
Split from F841 following discussion in #8884. Fixes #8884. <!-- Thank you for contributing to Ruff! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? - Does this pull request include references to any relevant issues? --> ## Summary <!-- What's the purpose of the change? What does it do, and why? --> Add a new rule for unused assignments in tuples. Remove similar behavior from F841. ## Test Plan Adapt F841 tests and move them over to the new rule. <!-- How was it tested? --> --------- Co-authored-by: Micha Reiser <micha@reiser.io>
This commit is contained in:
parent
be239b9f25
commit
c80678a1c0
20 changed files with 893 additions and 132 deletions
|
@ -445,7 +445,8 @@ fn tags(code: &str) -> Option<Vec<lsp_types::DiagnosticTag>> {
|
|||
match code {
|
||||
// F401: <module> imported but unused
|
||||
// F841: local variable <name> is assigned to but never used
|
||||
"F401" | "F841" => Some(vec![lsp_types::DiagnosticTag::UNNECESSARY]),
|
||||
// RUF059: Unused unpacked variable
|
||||
"F401" | "F841" | "RUF059" => Some(vec![lsp_types::DiagnosticTag::UNNECESSARY]),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue