Skip to content

FURB188 ignores the slice’s step #13349

@dscorbett

Description

@dscorbett

FURB188 can apply to any slice regardless of the slice’s step. FURB188 should only apply if the step is omitted, None, 1, or True.

$ ruff --version
ruff 0.6.5
$ cat furb188.py
text = "!x!y!z"
if text.startswith("!"):
    text = text[1::2]
print(text)
$ python furb188.py
xyz
$ ruff check --isolated --preview --target-version py39 --select FURB188 furb188.py --fix
Found 1 error (1 fixed, 0 remaining).
$ python furb188.py
x!y!z

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions