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

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

Closed
ember91 opened this issue Jul 17, 2024 · 1 comment · Fixed by #12364
Closed

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

ember91 opened this issue Jul 17, 2024 · 1 comment · Fixed by #12364
Assignees
Labels
bug Something isn't working

Comments

@ember91
Copy link
Contributor

ember91 commented 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.

@ember91 ember91 changed the title C419 does not warn if the second parameter is passed to sum() C419 in --preview does not warn if a second parameter is passed to sum() Jul 17, 2024
@charliermarsh
Copy link
Member

Perhaps issues aren't supposed to be created for --preview warnings. If so, let me know.

No, --preview issues are great! Thank you! That's one of the goals of shipping in --preview.

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

Successfully merging a pull request may close this issue.

2 participants