ruff/crates/ruff_python_formatter/src/expression
Charlie Marsh b763973357
Avoid hard line break after dangling open-parenthesis comments (#6380)
## Summary

Given:

```python
[  # comment
    first,
    second,
    third
]  # another comment
```

We were adding a hard line break as part of the formatting of `#
comment`, which led to the following formatting:

```python
[first, second, third]  # comment
  # another comment
```

Closes https://github.com/astral-sh/ruff/issues/6367.
2023-08-07 14:15:32 +00:00
..
expr_attribute.rs Call chain formatting in fluent style (#6151) 2023-08-04 13:58:01 +00:00
expr_await.rs Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
expr_bin_op.rs Call chain formatting in fluent style (#6151) 2023-08-04 13:58:01 +00:00
expr_bool_op.rs Replace Formatter<PyFormatContext<'_>> with PyFormatter (#6330) 2023-08-04 10:48:58 +02:00
expr_call.rs Call chain formatting in fluent style (#6151) 2023-08-04 13:58:01 +00:00
expr_compare.rs Replace Formatter<PyFormatContext<'_>> with PyFormatter (#6330) 2023-08-04 10:48:58 +02:00
expr_constant.rs Replace .map_or(false, $closure) with .is_some_and(closure) (#6244) 2023-08-01 19:29:42 +02:00
expr_dict.rs Replace Formatter<PyFormatContext<'_>> with PyFormatter (#6330) 2023-08-04 10:48:58 +02:00
expr_dict_comp.rs Tweak breaking groups for comprehensions (#6321) 2023-08-04 14:00:54 +00:00
expr_formatted_value.rs Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
expr_generator_exp.rs Tweak breaking groups for comprehensions (#6321) 2023-08-04 14:00:54 +00:00
expr_if_exp.rs Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
expr_joined_str.rs format ExprJoinedStr (#5932) 2023-08-01 08:26:30 +02:00
expr_lambda.rs Fix formatting of lambda star arguments (#6257) 2023-08-02 19:31:20 +00:00
expr_line_magic.rs Replace Formatter<PyFormatContext<'_>> with PyFormatter (#6330) 2023-08-04 10:48:58 +02:00
expr_list.rs Generalize comment-after-bracket handling to lists, sets, etc. (#6320) 2023-08-04 01:28:05 +00:00
expr_list_comp.rs Tweak breaking groups for comprehensions (#6321) 2023-08-04 14:00:54 +00:00
expr_name.rs Remove Parse trait (#6235) 2023-08-01 18:35:03 +02:00
expr_named_expr.rs Remove parentheses around some walrus operators (#6173) 2023-07-29 10:06:26 -04:00
expr_set.rs Generalize comment-after-bracket handling to lists, sets, etc. (#6320) 2023-08-04 01:28:05 +00:00
expr_set_comp.rs Tweak breaking groups for comprehensions (#6321) 2023-08-04 14:00:54 +00:00
expr_slice.rs Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
expr_starred.rs Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
expr_subscript.rs Call chain formatting in fluent style (#6151) 2023-08-04 13:58:01 +00:00
expr_tuple.rs Replace Formatter<PyFormatContext<'_>> with PyFormatter (#6330) 2023-08-04 10:48:58 +02:00
expr_unary_op.rs Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
expr_yield.rs Replace Formatter<PyFormatContext<'_>> with PyFormatter (#6330) 2023-08-04 10:48:58 +02:00
expr_yield_from.rs Add AnyExpressionYield to consolidate ExprYield and ExprYieldFrom (#6127) 2023-07-27 16:01:16 +00:00
mod.rs Call chain formatting in fluent style (#6151) 2023-08-04 13:58:01 +00:00
number.rs Replace Formatter<PyFormatContext<'_>> with PyFormatter (#6330) 2023-08-04 10:48:58 +02:00
parentheses.rs Avoid hard line break after dangling open-parenthesis comments (#6380) 2023-08-07 14:15:32 +00:00
string.rs Replace Formatter<PyFormatContext<'_>> with PyFormatter (#6330) 2023-08-04 10:48:58 +02:00