From 16b0902e287d884683ab865717129714f0577520 Mon Sep 17 00:00:00 2001 From: Brent Westbrook <36778786+ntBre@users.noreply.github.com> Date: Wed, 12 Mar 2025 14:12:28 -0400 Subject: [PATCH] [`ruff`] Stabilize `unnecessary-nested-literal` (`RUF041`) (#16648) Summary -- Stabilizes RUF041. The tests are already in the right place, and the docs look good. Test Plan -- 0 issues, 1 [PR] fixing nested literals and unions the day after the rule was added. No changes since then I wonder if the fix in that PR could be relevant for https://github.com/astral-sh/ruff/pull/16639, where I noticed a potential issue with `Union`. It could be unrelated, though. [PR]: https://github.com/astral-sh/ruff/pull/14641 --- 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 5979d3978c..2d8103c3ec 100644 --- a/crates/ruff_linter/src/codes.rs +++ b/crates/ruff_linter/src/codes.rs @@ -998,7 +998,7 @@ pub fn code_to_rule(linter: Linter, code: &str) -> Option<(RuleGroup, Rule)> { (Ruff, "038") => (RuleGroup::Preview, rules::ruff::rules::RedundantBoolLiteral), (Ruff, "039") => (RuleGroup::Preview, rules::ruff::rules::UnrawRePattern), (Ruff, "040") => (RuleGroup::Stable, rules::ruff::rules::InvalidAssertMessageLiteralArgument), - (Ruff, "041") => (RuleGroup::Preview, rules::ruff::rules::UnnecessaryNestedLiteral), + (Ruff, "041") => (RuleGroup::Stable, rules::ruff::rules::UnnecessaryNestedLiteral), (Ruff, "043") => (RuleGroup::Preview, rules::ruff::rules::PytestRaisesAmbiguousPattern), (Ruff, "045") => (RuleGroup::Preview, rules::ruff::rules::ImplicitClassVarInDataclass), (Ruff, "046") => (RuleGroup::Stable, rules::ruff::rules::UnnecessaryCastToInt),