Add tests for redirected rules (#9754)

Extends https://github.com/astral-sh/ruff/pull/9752 adding internal test
rules for redirection

Fixes a bug where we did not see warnings for exact codes that are
redirected (just prefixes)
This commit is contained in:
Zanie Blue 2024-02-01 10:46:36 -06:00
parent 46c0937bfa
commit 0d752e56cd
6 changed files with 195 additions and 6 deletions

View file

@ -940,6 +940,10 @@ impl LintConfiguration {
if let RuleSelector::Prefix {
prefix,
redirected_from: Some(redirect_from),
}
| RuleSelector::Rule {
prefix,
redirected_from: Some(redirect_from),
} = selector
{
redirects.insert(redirect_from, prefix);