Skip to content

Safe fix for B033 can remove comments #22629

@ntBre

Description

@ntBre

I'll open a follow-up issue for this since it's not related to your PR, but this shouldn't always be a safe fix either:

❯ cat <<EOF | ruff check --diff --select B033 -
∙ {1, 2, 3,
# comment
1}
∙ EOF
@@ -1,3 +1 @@
-{1, 2, 3,
-# comment
-1}
+{1, 2, 3}

Would fix 1 error.

Originally posted by @ntBre in #22114

Metadata

Metadata

Assignees

Labels

fixesRelated to suggested fixes for violationsgood first issueGood for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions