-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[pylint
] Do not trigger PLR6201
on empty collections
#15732
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
Conversation
|
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
PLR6201 | 2 | 0 | 2 | 0 | 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you!
I also agree with you that if someone writes 1 in []
it's probably an error, but this isn't the right rule to describe the error...
pylint
] Do not trigger PLR6201
on empty collections
* main: Run `cargo update` (#15769) [red-knot] Document public symbol type inferece (#15766) Update dawidd6/action-download-artifact action to v8 (#15760) Update NPM Development dependencies (#15758) Update pre-commit dependencies (#15756) Update dependency ruff to v0.9.3 (#15755) Update dependency mdformat-mkdocs to v4.1.2 (#15754) Update Rust crate uuid to v1.12.1 (#15753) Update Rust crate unicode-ident to v1.0.15 (#15752) Fix docstring in ruff_annotate_snippets (#15748) Update Rust crate insta to v1.42.1 (#15751) Update Rust crate clap to v4.5.27 (#15750) Add references to `trio.run_process` and `anyio.run_process` (#15761) [`ruff`] Do not emit diagnostic when all arguments to `zip()` are variadic (`RUF058`) (#15744) [red-knot] Ensure differently ordered unions are considered equivalent when they appear inside tuples inside top-level intersections (#15743) [red-knot] Ensure differently ordered unions and intersections are understood as equivalent even inside arbitrarily nested tuples (#15740) [red-knot] Promote the `all_type_pairs_are_assignable_to_their_union` property test to stable (#15739) [`pylint`] Do not trigger `PLR6201` on empty collections (#15732) Improve the file watching failure error message (#15728) Speed symbol state merging back up (#15731)
## Summary Introducing a new rule based on discussions in astral-sh#15732 and astral-sh#15729 that checks for unnecessary in with empty collections. I called it in_empty_collection and gave the rule number RUF060. Rule is in preview group.
Fixes #15729.