[ruff] Implement falsy-dict-get-fallback (RUF056) (#15160)

Co-authored-by: Micha Reiser <micha@reiser.io>
This commit is contained in:
Arnav Gupta 2024-12-31 05:40:51 -05:00 committed by GitHub
parent 68d2466832
commit 3c9021ffcb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
51 changed files with 897 additions and 88 deletions

View file

@ -991,6 +991,7 @@ pub fn code_to_rule(linter: Linter, code: &str) -> Option<(RuleGroup, Rule)> {
(Ruff, "051") => (RuleGroup::Preview, rules::ruff::rules::IfKeyInDictDel),
(Ruff, "052") => (RuleGroup::Preview, rules::ruff::rules::UsedDummyVariable),
(Ruff, "055") => (RuleGroup::Preview, rules::ruff::rules::UnnecessaryRegularExpression),
(Ruff, "056") => (RuleGroup::Preview, rules::ruff::rules::FalsyDictGetFallback),
(Ruff, "100") => (RuleGroup::Stable, rules::ruff::rules::UnusedNOQA),
(Ruff, "101") => (RuleGroup::Stable, rules::ruff::rules::RedirectedNOQA),