Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FURB188 ignores the slice’s step #13349

Closed
dscorbett opened this issue Sep 14, 2024 · 1 comment · Fixed by #13405
Closed

FURB188 ignores the slice’s step #13349

dscorbett opened this issue Sep 14, 2024 · 1 comment · Fixed by #13405
Labels
bug Something isn't working

Comments

@dscorbett
Copy link

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
@dylwil3
Copy link
Collaborator

dylwil3 commented Sep 14, 2024

Thanks! I'm visiting family the next few days but I should be able to fix this early next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants