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

Ruff --fix on COM812 introducing TypeError #4480

Closed
fennerm opened this issue May 17, 2023 · 2 comments · Fixed by #4493
Closed

Ruff --fix on COM812 introducing TypeError #4480

fennerm opened this issue May 17, 2023 · 2 comments · Fixed by #4493
Assignees
Labels
bug Something isn't working fixes Related to suggested fixes for violations

Comments

@fennerm
Copy link

fennerm commented May 17, 2023

I think I'm seeing some buggy behavior with the COM812 rule (running ruff v0.0.267).

Minimal example:

from collections import namedtuple

foo = namedtuple(
    name="foo",
    status="bar",
    message="sfdsdfsdgs fsdfsdf output!dsfdfsdjkg  ghfskdjghkdssd sd fsdf  s\n"[
        :20
    ],
)

Ruff returns error: 7:13: COM812 [*] Trailing comma missing. ruff --fix inserts a comma after :20 which is a TypeError.

@charliermarsh charliermarsh added bug Something isn't working fixes Related to suggested fixes for violations autofix-error labels May 17, 2023
@charliermarsh
Copy link
Member

Thanks for reporting!

@JonathanPlasse
Copy link
Contributor

I can work on it.

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

Successfully merging a pull request may close this issue.

3 participants