-
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.
Avoid parenthesizing unsplittable because of comments
- Loading branch information
1 parent
df4dc04
commit 9ca1296
Showing
8 changed files
with
322 additions
and
40 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
...python_formatter/resources/test/fixtures/ruff/expression/optional_parentheses_comments.py
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
comment_string = "Long lines with inline comments should have their comments appended to the reformatted string's enclosing right parentheses." # This comment gets thrown to the top. | ||
|
||
|
||
## ident, 83 columns, comment 89 columns | ||
____aaa = ( | ||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbvvvvvvvvvvv # ccc | ||
) | ||
|
||
____aaa = ( | ||
# leading | ||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbvvvvvvvvvvv | ||
) # ccc | ||
|
||
## ident, 83 columns, comment 88 columns | ||
____aaa = ( | ||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbvvvvvvvvvvv # cc | ||
) | ||
|
||
## ident, 83 columns, comment 87 columns | ||
____aaa = ( | ||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbvvvvvvvvvvv # c | ||
) | ||
|
||
____[a] = ( | ||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbvvvvvvvvvvv # c | ||
) | ||
|
||
# 88 column | ||
a = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa and bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb | ||
# 89 | ||
a = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa and bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb | ||
|
||
|
||
def setUpTestData(cls): | ||
cls.happening = ( | ||
Happening.objects.create() | ||
) # make sure the defaults are working (#20158) | ||
|
||
def setUpTestData(cls): | ||
cls.happening = ( | ||
Happening.objects.create # make sure the defaults are working (#20158) | ||
) | ||
|
||
if True: | ||
if True: | ||
if True: | ||
# Black layout | ||
model.config.use_cache = ( | ||
False # FSTM still requires this hack -> FSTM should probably be refactored s | ||
) | ||
|
||
|
||
req.META[ | ||
"SERVER_NAME" | ||
] = "testservereeeeeeeeee" # Required to have redirect work in l |
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
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
Oops, something went wrong.