From 620b84443b76bc2c4d6e1b3f44f74d5da67dc18d Mon Sep 17 00:00:00 2001 From: Brent Westbrook <36778786+ntBre@users.noreply.github.com> Date: Mon, 9 Jun 2025 09:54:20 -0400 Subject: [PATCH] [pyupgrade] Stabilize private-type-parameter (UP049) (#18515) ## Summary Stabilizes the UP049 rule (private-type-parameter) by moving it from Preview to Stable. UP049 detects and fixes the use of private type parameters (those with leading underscores) in PEP 695 generic classes and functions. ## Test plan - Verified that UP049 tests pass: `crates/ruff_linter/src/rules/pyupgrade/mod.rs` - Ran full test suite with `make test` - Confirmed that no test migration was needed as UP049 was already in the main `rules` test function ## Rule documentation https://docs.astral.sh/ruff/rules/private-type-parameter/ --- crates/ruff_linter/src/codes.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ruff_linter/src/codes.rs b/crates/ruff_linter/src/codes.rs index c8330bfdc8..06320914a3 100644 --- a/crates/ruff_linter/src/codes.rs +++ b/crates/ruff_linter/src/codes.rs @@ -552,7 +552,7 @@ pub fn code_to_rule(linter: Linter, code: &str) -> Option<(RuleGroup, Rule)> { (Pyupgrade, "045") => (RuleGroup::Preview, rules::pyupgrade::rules::NonPEP604AnnotationOptional), (Pyupgrade, "046") => (RuleGroup::Preview, rules::pyupgrade::rules::NonPEP695GenericClass), (Pyupgrade, "047") => (RuleGroup::Preview, rules::pyupgrade::rules::NonPEP695GenericFunction), - (Pyupgrade, "049") => (RuleGroup::Preview, rules::pyupgrade::rules::PrivateTypeParameter), + (Pyupgrade, "049") => (RuleGroup::Stable, rules::pyupgrade::rules::PrivateTypeParameter), (Pyupgrade, "050") => (RuleGroup::Preview, rules::pyupgrade::rules::UselessClassMetaclassType), // pydocstyle