-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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`
- Loading branch information
1 parent
59e7089
commit 813d7da
Showing
4 changed files
with
44 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -372,9 +372,8 @@ func( | |
) | ||
func( | ||
( | ||
# outer comment | ||
# inner comment | ||
# outer comment | ||
( # inner comment | ||
[] | ||
) | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters