Skip to content

C419 in --preview does not warn if a second parameter is passed to sum() #12358

Closed
@ember91

Description

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions