mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-26 18:06:36 +00:00
## Summary Adds an extra check to F632 to check for any `is` comparisons to a mutable initialisers. Implements #8589 . Example: ```Python named_var = {} if named_var is {}: # F632 (fix) pass ``` The if condition will always evaluate to False because it checks on identity and it's impossible to take the same identity as a hard coded list/set/dict initializer. ## Test Plan Multiple test cases were added to ensure the rule works + doesn't flag false positives + the fix works correctly. |
||
|---|---|---|
| .. | ||
| fixtures | ||
| package | ||
| project | ||
| disallowed_rule_names.txt | ||