You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The fix for unnecessary-spread (PIE800) in Ruff 0.9.4 introduces a syntax error when unpacking an empty dictionary that appears before a comma.
$ echo'{**{},}'| ruff --isolated check --select PIE800 - --differror: Fix introduced a syntax error. Reverting all changes.This indicates a bug in Ruff. If you could open an issue at: https://github.com/astral-sh/ruff/issues/new?title=%5BFix%20error%5D...quoting the contents of `-`, the rule codes PIE800, along with the `pyproject.toml` settings and executed command, we'd be very appreciative!
The text was updated successfully, but these errors were encountered:
…tionary is empty (`PIE800`) (#16008)
## Summary
Resolves#15997.
Ruff used to introduce syntax errors while fixing these cases, but no
longer will:
```python
{"a": [], **{},}
# ^^^^ Removed, leaving two contiguous commas
{"a": [], **({})}
# ^^^^^ Removed, leaving a stray closing parentheses
```
Previously, the function would take a shortcut if the unpacked
dictionary is empty; now, both cases are handled using the same logic
introduced in #15394. This change slightly modifies that logic to also
remove the first comma following the dictionary, if and only if it is
empty.
## Test Plan
`cargo nextest run` and `cargo insta test`.
Description
The fix for
unnecessary-spread
(PIE800) in Ruff 0.9.4 introduces a syntax error when unpacking an empty dictionary that appears before a comma.The text was updated successfully, but these errors were encountered: