Skip to content

Commit fce5d89

Browse files
ntBreMichaReiser
authored andcommitted
[flake8-simplify] Stabilize split-static-string (SIM905) (#16631)
Summary -- Stabilizes SIM905 and adds a small addition to the docs. The test was already in the right place. Test Plan -- No issues except 2 recent, general issues about whitespace normalization.
1 parent 66cae0a commit fce5d89

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

crates/ruff_linter/src/codes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ pub fn code_to_rule(linter: Linter, code: &str) -> Option<(RuleGroup, Rule)> {
489489
(Flake8Simplify, "223") => (RuleGroup::Stable, rules::flake8_simplify::rules::ExprAndFalse),
490490
(Flake8Simplify, "300") => (RuleGroup::Stable, rules::flake8_simplify::rules::YodaConditions),
491491
(Flake8Simplify, "401") => (RuleGroup::Stable, rules::flake8_simplify::rules::IfElseBlockInsteadOfDictGet),
492-
(Flake8Simplify, "905") => (RuleGroup::Preview, rules::flake8_simplify::rules::SplitStaticString),
492+
(Flake8Simplify, "905") => (RuleGroup::Stable, rules::flake8_simplify::rules::SplitStaticString),
493493
(Flake8Simplify, "910") => (RuleGroup::Stable, rules::flake8_simplify::rules::DictGetWithNoneDefault),
494494
(Flake8Simplify, "911") => (RuleGroup::Stable, rules::flake8_simplify::rules::ZipDictKeysAndValues),
495495

crates/ruff_linter/src/rules/flake8_simplify/rules/split_static_string.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ use crate::checkers::ast::Checker;
3939
/// ).split(",")
4040
/// ```
4141
///
42+
/// as this is converted to `["a", "b"]` without any of the comments.
43+
///
4244
/// ## References
4345
/// - [Python documentation: `str.split`](https://docs.python.org/3/library/stdtypes.html#str.split)
4446
#[derive(ViolationMetadata)]

0 commit comments

Comments
 (0)