Skip to content

SIM905 diagnostic mentions str.split instead of str.rsplit #20456

@dscorbett

Description

@dscorbett

Summary

The diagnostic for split-static-string (SIM905) mentions str.split even when the relevant method is str.rsplit. Example:

$ cat >sim905.py <<'# EOF'
"a,b,c,d".rsplit(",")
# EOF

$ ruff --isolated check sim905.py --select SIM905 --output-format concise -q
sim905.py:1:1: SIM905 [*] Consider using a list literal instead of `str.split`

Version

ruff 0.13.0 (a1fdd66 2025-09-10)

Metadata

Metadata

Assignees

No one assigned

    Labels

    diagnosticsRelated to reporting of diagnostics.good first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions