ruff/crates/ruff_python_formatter/src
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
..
comments Avoid hard line break after dangling open-parenthesis comments (#6380) 2023-08-07 14:15:32 +00:00
expression Avoid hard line break after dangling open-parenthesis comments (#6380) 2023-08-07 14:15:32 +00:00
module Add empty lines before nested functions and classes (#6206) 2023-08-01 15:30:59 +00:00
other Use parenthesized_with_dangling_comments in arguments formatter (#6376) 2023-08-07 09:43:57 -04:00
pattern Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
snapshots Remove exception-handler lexing from unused-bound-exception fix (#5851) 2023-07-18 18:27:46 +00:00
statement Refactor and rename skip_trailing_trivia (#6312) 2023-08-04 13:30:53 +00:00
type_param Replace Formatter<PyFormatContext<'_>> with PyFormatter (#6330) 2023-08-04 10:48:58 +02:00
builders.rs Add formatter support for call and class definition Arguments (#6274) 2023-08-02 11:54:22 -04:00
cli.rs Formatter: Add SourceType to context to enable special formatting for stub files (#6331) 2023-08-04 11:52:26 +00:00
context.rs formatter: WithNodeLevel helper (#6212) 2023-07-31 21:22:17 +00:00
generated.rs Replace Formatter<PyFormatContext<'_>> with PyFormatter (#6330) 2023-08-04 10:48:58 +02:00
lib.rs Formatter: Add SourceType to context to enable special formatting for stub files (#6331) 2023-08-04 11:52:26 +00:00
main.rs Formatter: Add SourceType to context to enable special formatting for stub files (#6331) 2023-08-04 11:52:26 +00:00
options.rs Formatter: Add SourceType to context to enable special formatting for stub files (#6331) 2023-08-04 11:52:26 +00:00
prelude.rs Accept any Into<AnyNodeRef> as Comments arguments (#5205) 2023-06-20 16:49:21 +00:00