-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
ruleImplementing or modifying a lint ruleImplementing or modifying a lint rule
Description
I ran into this oddity. The suggested fix for C401 actually results in C416 because i isn't transformed in any way. Is there a better way to indicate this in the error message?
_a = set(i for i in range(10))
_b = {i for i in range(10)}
_c = set(range(10))$ poetry run ruff check --output-format full test.py
test.py:1:6: C401 Unnecessary generator (rewrite as a `set` comprehension)
|
1 | _a = set(i for i in range(10))
| ^^^^^^^^^^^^^^^^^^^^^^^^^ C401
2 | _b = {i for i in range(10)}
3 | _c = set(range(10))
|
= help: Rewrite as a `set` comprehension
test.py:2:6: C416 Unnecessary `set` comprehension (rewrite using `set()`)
|
1 | _a = set(i for i in range(10))
2 | _b = {i for i in range(10)}
| ^^^^^^^^^^^^^^^^^^^^^^ C416
3 | _c = set(range(10))
|
= help: Rewrite using `set()`
Found 2 errors.
No fixes available (2 hidden fixes can be enabled with the `--unsafe-fixes` option).
$ poetry run ruff --version
ruff 0.2.2
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
ruleImplementing or modifying a lint ruleImplementing or modifying a lint rule