Skip to content

Commit 18a134a

Browse files
committed
[ruff] Stabilize class-with-mixed-type-vars (RUF053) (#18512)
This PR stabilizes the RUF053 rule by moving it from preview to stable status for the 0.12.0 release. ## Summary - **Rule**: RUF053 (`class-with-mixed-type-vars`) - **Purpose**: Detects classes that have both PEP 695 type parameter lists while also inheriting from `typing.Generic` - **Change**: Move from `RuleGroup::Preview` to `RuleGroup::Stable` in `codes.rs` and migrate preview tests to stable tests ## Verification Links - **Tests**: [ruff/mod.rs](https://github.com/astral-sh/ruff/blob/main/crates/ruff_linter/src/rules/ruff/mod.rs#L98) - Shows RUF053 moved from preview_rules to main rules test function - **Documentation**: https://docs.astral.sh/ruff/rules/class-with-mixed-type-vars/ - Current documentation shows preview status that will be automatically updated
1 parent c063940 commit 18a134a

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed

crates/ruff_linter/src/codes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ pub fn code_to_rule(linter: Linter, code: &str) -> Option<(RuleGroup, Rule)> {
10191019
(Ruff, "049") => (RuleGroup::Preview, rules::ruff::rules::DataclassEnum),
10201020
(Ruff, "051") => (RuleGroup::Stable, rules::ruff::rules::IfKeyInDictDel),
10211021
(Ruff, "052") => (RuleGroup::Preview, rules::ruff::rules::UsedDummyVariable),
1022-
(Ruff, "053") => (RuleGroup::Preview, rules::ruff::rules::ClassWithMixedTypeVars),
1022+
(Ruff, "053") => (RuleGroup::Stable, rules::ruff::rules::ClassWithMixedTypeVars),
10231023
(Ruff, "054") => (RuleGroup::Preview, rules::ruff::rules::IndentedFormFeed),
10241024
(Ruff, "055") => (RuleGroup::Preview, rules::ruff::rules::UnnecessaryRegularExpression),
10251025
(Ruff, "056") => (RuleGroup::Preview, rules::ruff::rules::FalsyDictGetFallback),

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ mod tests {
9595
#[test_case(Rule::MapIntVersionParsing, Path::new("RUF048_1.py"))]
9696
#[test_case(Rule::IfKeyInDictDel, Path::new("RUF051.py"))]
9797
#[test_case(Rule::UsedDummyVariable, Path::new("RUF052.py"))]
98+
#[test_case(Rule::ClassWithMixedTypeVars, Path::new("RUF053.py"))]
9899
#[test_case(Rule::FalsyDictGetFallback, Path::new("RUF056.py"))]
99100
#[test_case(Rule::UnusedUnpackedVariable, Path::new("RUF059_0.py"))]
100101
#[test_case(Rule::UnusedUnpackedVariable, Path::new("RUF059_1.py"))]
@@ -484,7 +485,6 @@ mod tests {
484485
#[test_case(Rule::DataclassEnum, Path::new("RUF049.py"))]
485486
#[test_case(Rule::StarmapZip, Path::new("RUF058_0.py"))]
486487
#[test_case(Rule::StarmapZip, Path::new("RUF058_1.py"))]
487-
#[test_case(Rule::ClassWithMixedTypeVars, Path::new("RUF053.py"))]
488488
#[test_case(Rule::IndentedFormFeed, Path::new("RUF054.py"))]
489489
#[test_case(Rule::ImplicitClassVarInDataclass, Path::new("RUF045.py"))]
490490
fn preview_rules(rule_code: Rule, path: &Path) -> Result<()> {

0 commit comments

Comments
 (0)