ruff/crates/ruff_linter
InSync bb979e05ac
[flake8-pie] Remove following comma correctly when the unpacked dictionary 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`.
2025-02-07 08:52:10 +01:00
..
resources [flake8-pie] Remove following comma correctly when the unpacked dictionary is empty (PIE800) (#16008) 2025-02-07 08:52:10 +01:00
src [flake8-pie] Remove following comma correctly when the unpacked dictionary is empty (PIE800) (#16008) 2025-02-07 08:52:10 +01:00
Cargo.toml Bump version to 0.9.5 (#16002) 2025-02-06 13:24:45 -06:00