ruff/crates/ruff_linter
InSync 3d0a58eb60
[pyupgrade] Unwrap unary expressions correctly (UP018) (#15919)
## Summary

Resolves #15859.

The rule now adds parentheses if the original call wraps an unary
expression and is:

* The left-hand side of a binary expression where the operator is `**`.
* The caller of a call expression.
* The subscripted of a subscript expression.
* The object of an attribute access.

The fix will also be marked as unsafe if there are any comments in its
range.

## Test Plan

`cargo nextest run` and `cargo insta test`.
2025-02-14 08:42:00 +01:00
..
resources [pyupgrade] Unwrap unary expressions correctly (UP018) (#15919) 2025-02-14 08:42:00 +01:00
src [pyupgrade] Unwrap unary expressions correctly (UP018) (#15919) 2025-02-14 08:42:00 +01:00
Cargo.toml Bump version to 0.9.6 (#16074) 2025-02-10 18:14:04 +05:30