ruff
Fix panic when formatting comments in unary expressions
#21501
Merged

Fix panic when formatting comments in unary expressions #21501

ntBre merged 18 commits into main from brent/unary-3
ntBre
ntBre failed attempt at re-partitioning dangling comments
9fda4d1a
ntBre looking very reasonable
e7a838a0
ntBre grab the tests from the other PR, update needs_parentheses
7b1da064
ntBre remove commented code
d9486aa4
ntBre heavy debugging, I think I found the root cause
e4dc4b2a
ntBre revert debugging code, get something working?
2d9b3fe6
ntBre update comments and range variable name
c7fc1212
ntBre avoid computing operand_start for each dangling comment
60317c83
ntBre try dangling as trailing
7e193df2
ntBre ntBre added bug
ntBre ntBre added formatter
astral-sh-bot
ntBre
ntBre commented on 2025-11-17
ntBre ntBre marked this pull request as ready for review 304 days ago
ntBre ntBre requested a review from MichaReiser MichaReiser 304 days ago
MichaReiser
MichaReiser commented on 2025-11-17
ntBre update handle_unary_op_comment docs
31d43c58
ntBre reuse leading_operand_comments
a50e006c
ntBre simplify has_dangling check, move it before Never case
bd612c4d
ntBre
ntBre revert some now-unnecessary changes
91cb799f
ntBre ntBre requested a review from MichaReiser MichaReiser 304 days ago
MichaReiser
ntBre convert back to guarded returns
c0d4d91a
ntBre factor out needs_line_break, fix parenthesize bug
58cd40f4
ntBre add a few more tests
d89e1c27
MichaReiser
MichaReiser approved these changes on 2025-11-18
ntBre needs_line_break => OptionalParentheses::Always
9d86a5c5
ntBre add co-author
9e161513
ntBre ntBre merged cbc6863b into main 303 days ago
ntBre ntBre deleted the brent/unary-3 branch 303 days ago

Login to write a write a comment.

Login via GitHub

Reviewers
Assignees
No one assigned
Labels
Milestone