mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-19 11:45:40 +00:00
Stabilize starmap-zip (RUF058) (#18525)
## Summary - Stabilizes RUF058 (starmap-zip) rule by changing it from Preview to Stable - Migrates test cases from preview_rules to main rules function - Updates snapshots accordingly and removes old preview snapshots ## Test plan - ✅ Migrated tests from preview to main test function - ✅ `make check` passes - ✅ `make test` passes - ✅ `make citest` passes (no leftover snapshots) ## Rule Documentation - [Test file](https://github.com/astral-sh/ruff/blob/main/crates/ruff_linter/src/rules/ruff/mod.rs#L103-L104) - [Rule documentation](https://docs.astral.sh/ruff/rules/starmap-zip/)
This commit is contained in:
parent
ad9ae4e2b6
commit
72c8dc006f
4 changed files with 3 additions and 3 deletions
|
|
@ -1024,7 +1024,7 @@ pub fn code_to_rule(linter: Linter, code: &str) -> Option<(RuleGroup, Rule)> {
|
||||||
(Ruff, "055") => (RuleGroup::Preview, rules::ruff::rules::UnnecessaryRegularExpression),
|
(Ruff, "055") => (RuleGroup::Preview, rules::ruff::rules::UnnecessaryRegularExpression),
|
||||||
(Ruff, "056") => (RuleGroup::Preview, rules::ruff::rules::FalsyDictGetFallback),
|
(Ruff, "056") => (RuleGroup::Preview, rules::ruff::rules::FalsyDictGetFallback),
|
||||||
(Ruff, "057") => (RuleGroup::Stable, rules::ruff::rules::UnnecessaryRound),
|
(Ruff, "057") => (RuleGroup::Stable, rules::ruff::rules::UnnecessaryRound),
|
||||||
(Ruff, "058") => (RuleGroup::Preview, rules::ruff::rules::StarmapZip),
|
(Ruff, "058") => (RuleGroup::Stable, rules::ruff::rules::StarmapZip),
|
||||||
(Ruff, "059") => (RuleGroup::Preview, rules::ruff::rules::UnusedUnpackedVariable),
|
(Ruff, "059") => (RuleGroup::Preview, rules::ruff::rules::UnusedUnpackedVariable),
|
||||||
(Ruff, "060") => (RuleGroup::Preview, rules::ruff::rules::InEmptyCollection),
|
(Ruff, "060") => (RuleGroup::Preview, rules::ruff::rules::InEmptyCollection),
|
||||||
(Ruff, "061") => (RuleGroup::Preview, rules::ruff::rules::LegacyFormPytestRaises),
|
(Ruff, "061") => (RuleGroup::Preview, rules::ruff::rules::LegacyFormPytestRaises),
|
||||||
|
|
|
||||||
|
|
@ -98,6 +98,8 @@ mod tests {
|
||||||
#[test_case(Rule::ClassWithMixedTypeVars, Path::new("RUF053.py"))]
|
#[test_case(Rule::ClassWithMixedTypeVars, Path::new("RUF053.py"))]
|
||||||
#[test_case(Rule::FalsyDictGetFallback, Path::new("RUF056.py"))]
|
#[test_case(Rule::FalsyDictGetFallback, Path::new("RUF056.py"))]
|
||||||
#[test_case(Rule::UnnecessaryRound, Path::new("RUF057.py"))]
|
#[test_case(Rule::UnnecessaryRound, Path::new("RUF057.py"))]
|
||||||
|
#[test_case(Rule::StarmapZip, Path::new("RUF058_0.py"))]
|
||||||
|
#[test_case(Rule::StarmapZip, Path::new("RUF058_1.py"))]
|
||||||
#[test_case(Rule::UnusedUnpackedVariable, Path::new("RUF059_0.py"))]
|
#[test_case(Rule::UnusedUnpackedVariable, Path::new("RUF059_0.py"))]
|
||||||
#[test_case(Rule::UnusedUnpackedVariable, Path::new("RUF059_1.py"))]
|
#[test_case(Rule::UnusedUnpackedVariable, Path::new("RUF059_1.py"))]
|
||||||
#[test_case(Rule::UnusedUnpackedVariable, Path::new("RUF059_2.py"))]
|
#[test_case(Rule::UnusedUnpackedVariable, Path::new("RUF059_2.py"))]
|
||||||
|
|
@ -477,8 +479,6 @@ mod tests {
|
||||||
#[test_case(Rule::UnnecessaryRegularExpression, Path::new("RUF055_2.py"))]
|
#[test_case(Rule::UnnecessaryRegularExpression, Path::new("RUF055_2.py"))]
|
||||||
#[test_case(Rule::PytestRaisesAmbiguousPattern, Path::new("RUF043.py"))]
|
#[test_case(Rule::PytestRaisesAmbiguousPattern, Path::new("RUF043.py"))]
|
||||||
#[test_case(Rule::DataclassEnum, Path::new("RUF049.py"))]
|
#[test_case(Rule::DataclassEnum, Path::new("RUF049.py"))]
|
||||||
#[test_case(Rule::StarmapZip, Path::new("RUF058_0.py"))]
|
|
||||||
#[test_case(Rule::StarmapZip, Path::new("RUF058_1.py"))]
|
|
||||||
#[test_case(Rule::IndentedFormFeed, Path::new("RUF054.py"))]
|
#[test_case(Rule::IndentedFormFeed, Path::new("RUF054.py"))]
|
||||||
#[test_case(Rule::ImplicitClassVarInDataclass, Path::new("RUF045.py"))]
|
#[test_case(Rule::ImplicitClassVarInDataclass, Path::new("RUF045.py"))]
|
||||||
fn preview_rules(rule_code: Rule, path: &Path) -> Result<()> {
|
fn preview_rules(rule_code: Rule, path: &Path) -> Result<()> {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue