Skip to content

Commit 96913d1

Browse files
committed
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/)
1 parent e196d40 commit 96913d1

File tree

4 files changed

+3
-3
lines changed

4 files changed

+3
-3
lines changed

crates/ruff_linter/src/codes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,7 @@ pub fn code_to_rule(linter: Linter, code: &str) -> Option<(RuleGroup, Rule)> {
10241024
(Ruff, "055") => (RuleGroup::Preview, rules::ruff::rules::UnnecessaryRegularExpression),
10251025
(Ruff, "056") => (RuleGroup::Stable, rules::ruff::rules::FalsyDictGetFallback),
10261026
(Ruff, "057") => (RuleGroup::Stable, rules::ruff::rules::UnnecessaryRound),
1027-
(Ruff, "058") => (RuleGroup::Preview, rules::ruff::rules::StarmapZip),
1027+
(Ruff, "058") => (RuleGroup::Stable, rules::ruff::rules::StarmapZip),
10281028
(Ruff, "059") => (RuleGroup::Preview, rules::ruff::rules::UnusedUnpackedVariable),
10291029
(Ruff, "060") => (RuleGroup::Preview, rules::ruff::rules::InEmptyCollection),
10301030
(Ruff, "100") => (RuleGroup::Stable, rules::ruff::rules::UnusedNOQA),

crates/ruff_linter/src/rules/ruff/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ mod tests {
9898
#[test_case(Rule::ClassWithMixedTypeVars, Path::new("RUF053.py"))]
9999
#[test_case(Rule::FalsyDictGetFallback, Path::new("RUF056.py"))]
100100
#[test_case(Rule::UnnecessaryRound, Path::new("RUF057.py"))]
101+
#[test_case(Rule::StarmapZip, Path::new("RUF058_0.py"))]
102+
#[test_case(Rule::StarmapZip, Path::new("RUF058_1.py"))]
101103
#[test_case(Rule::UnusedUnpackedVariable, Path::new("RUF059_0.py"))]
102104
#[test_case(Rule::UnusedUnpackedVariable, Path::new("RUF059_1.py"))]
103105
#[test_case(Rule::UnusedUnpackedVariable, Path::new("RUF059_2.py"))]
@@ -474,8 +476,6 @@ mod tests {
474476
#[test_case(Rule::UnnecessaryRegularExpression, Path::new("RUF055_2.py"))]
475477
#[test_case(Rule::PytestRaisesAmbiguousPattern, Path::new("RUF043.py"))]
476478
#[test_case(Rule::DataclassEnum, Path::new("RUF049.py"))]
477-
#[test_case(Rule::StarmapZip, Path::new("RUF058_0.py"))]
478-
#[test_case(Rule::StarmapZip, Path::new("RUF058_1.py"))]
479479
#[test_case(Rule::IndentedFormFeed, Path::new("RUF054.py"))]
480480
#[test_case(Rule::ImplicitClassVarInDataclass, Path::new("RUF045.py"))]
481481
fn preview_rules(rule_code: Rule, path: &Path) -> Result<()> {

0 commit comments

Comments
 (0)