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
# Inputif (
(1+2) or# test
(3+4) or# other
(4+5) # more
): passif (
(1and2) +# test
(3and4) +# other
(4and5) # more
): passif (
(1+2) <# test
(3+4) ># other
(4+5) # more
): pass# Outputif (
(
1+2# test
)
or (
3+4# other
)
or (4+5) # more
):
passif (
(
1and2# test
)
+ (3and4) # other+ (4and5) # more
):
passif (
(
1+2# test
)
< (
3+4# other
)
> (4+5) # more
):
pass
Expected
Ruff not to expand the parenthesized right sides.
Uff this is harder than I expected. The issue is that our comment logic doesn't distinguish between
(
a# comment
)
(a) # comment
It always formats the comment inside of the parentheses instead of only doing so if the comment is inside the parentheses in the source. I thought I have a clever quick fix that manually moves the trailing comments out inside of FormatExpr if it is passed a ) but I now run into stability issues with function return type annotations 🙅
Expected
Ruff not to expand the parenthesized right sides.
The text was updated successfully, but these errors were encountered: