Respect own-line leading comments before parenthesized nodes (#6820)

## Summary

This PR ensures that if an expression has an own-line leading comment
_before_ its open parentheses, we render it as such.

For example, given:

```python
[ # foo
    # bar
    ( # baz
        1
    )
]
```

On `main`, we format as:

```python
[  # foo
    (
        # bar
        # baz
        1
    )
]
```

As of this PR, we format as:

```python
[  # foo
    # bar
    (  # baz
        1
    )
]
```

## Test Plan

`cargo test`
This commit is contained in:
Charlie Marsh 2023-08-25 00:18:05 -04:00 committed by GitHub
parent 59e70896c0
commit 813d7da7ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 16 deletions

View file

@ -50,3 +50,11 @@ c1 = [ # trailing open bracket
second,
third
] # outer comment
[ # inner comment
# own-line comment
( # end-of-line comment
# own-line comment
first,
),
] # outer comment