From ae6d9664bf4fee442232ea975c76600e9019d4b5 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Tue, 25 Jun 2024 16:04:01 +0100 Subject: [PATCH] Stabilise rules RUF024 and RUF026 (#12026) --- crates/ruff_linter/resources/test/fixtures/ruff/RUF026.py | 2 +- crates/ruff_linter/src/codes.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/ruff_linter/resources/test/fixtures/ruff/RUF026.py b/crates/ruff_linter/resources/test/fixtures/ruff/RUF026.py index 8d593481e7be4..c607b8b1b3dec 100644 --- a/crates/ruff_linter/resources/test/fixtures/ruff/RUF026.py +++ b/crates/ruff_linter/resources/test/fixtures/ruff/RUF026.py @@ -110,7 +110,7 @@ def func(): def func(): - defaultdict(dict, defaultdict=list) # OK + defaultdict(dict, default_factory=list) # OK def func(): diff --git a/crates/ruff_linter/src/codes.rs b/crates/ruff_linter/src/codes.rs index 781b48240b9f2..6871716ec8ca9 100644 --- a/crates/ruff_linter/src/codes.rs +++ b/crates/ruff_linter/src/codes.rs @@ -930,9 +930,9 @@ pub fn code_to_rule(linter: Linter, code: &str) -> Option<(RuleGroup, Rule)> { (Ruff, "021") => (RuleGroup::Preview, rules::ruff::rules::ParenthesizeChainedOperators), (Ruff, "022") => (RuleGroup::Preview, rules::ruff::rules::UnsortedDunderAll), (Ruff, "023") => (RuleGroup::Preview, rules::ruff::rules::UnsortedDunderSlots), - (Ruff, "024") => (RuleGroup::Preview, rules::ruff::rules::MutableFromkeysValue), + (Ruff, "024") => (RuleGroup::Stable, rules::ruff::rules::MutableFromkeysValue), (Ruff, "025") => (RuleGroup::Preview, rules::ruff::rules::UnnecessaryDictComprehensionForIterable), - (Ruff, "026") => (RuleGroup::Preview, rules::ruff::rules::DefaultFactoryKwarg), + (Ruff, "026") => (RuleGroup::Stable, rules::ruff::rules::DefaultFactoryKwarg), (Ruff, "027") => (RuleGroup::Preview, rules::ruff::rules::MissingFStringSyntax), (Ruff, "028") => (RuleGroup::Preview, rules::ruff::rules::InvalidFormatterSuppressionComment), (Ruff, "029") => (RuleGroup::Preview, rules::ruff::rules::UnusedAsync),