C419 in --preview does not warn if a second parameter is passed to sum() #12358
Closed
Description
opened on Jul 17, 2024
List of keywords searched before creating this issue:
C419
Minimal code snippet that reproduces the bug
# test.py
a = [1, 2]
print(sum([x for x in a]))
print(sum([x for x in a], 0))
Invoked command
Assuming test.py
contains the content pasted above:
ruff check --preview test.py
Current Ruff settings
[tool.ruff.lint]
select = [
"C419",
]
Current Ruff version
0.5.2
Description
Perhaps issues aren't supposed to be created for --preview
warnings. If so, let me know.
The C419 warning will trigger for line 3 but not for line 4. I expected that it would trigger for both lines.
Activity