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
## Summary
Closes#5781
## Test Plan
Added cases to
`crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/named_expr.py`
one-by-one and adjusted the condition as needed.
Our formatter currently always adds parentheses around the walrus (
a := 5
) operator in for/if/... casesruff/crates/ruff_python_formatter/src/expression/expr_named_expr.rs
Lines 32 to 41 in 3cda89e
The goal of this issue is to implement black's parentheses behavior (inside
NeedsParentheses
) and only preserve parentheses that are necessary.https://github.com/psf/black/blob/b4dca26c7d93f930bbd5a7b552807370b60d4298/src/black/linegen.py#L1387-L1401
The text was updated successfully, but these errors were encountered: