mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 10:22:24 +00:00
Fix panic when formatting binary expression with two implicit concatenated string operands (#7287)
This commit is contained in:
parent
1e6df19a35
commit
08f19226b9
3 changed files with 109 additions and 37 deletions
|
@ -175,6 +175,26 @@ c = (a
|
|||
# test trailing operator comment
|
||||
b
|
||||
)
|
||||
|
||||
c = ("a" "b" +
|
||||
# test leading binary comment
|
||||
"a" "b"
|
||||
)
|
||||
|
||||
(
|
||||
b + c + d +
|
||||
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
"bbbbbbbbbbbbbbbbbbbbbbbbbbbbb" +
|
||||
"cccccccccccccccccccccccccc"
|
||||
"dddddddddddddddddddddddddd"
|
||||
% aaaaaaaaaaaa
|
||||
+ x
|
||||
)
|
||||
|
||||
"a" "b" "c" + "d" "e" + "f" "g" + "h" "i" "j"
|
||||
class EC2REPATH:
|
||||
f.write ("Pathway name" + "\t" "Database Identifier" + "\t" "Source database" + "\n")
|
||||
|
||||
```
|
||||
|
||||
## Output
|
||||
|
@ -363,6 +383,26 @@ c = (
|
|||
# test trailing operator comment
|
||||
b
|
||||
)
|
||||
|
||||
c = (
|
||||
"a"
|
||||
"b" +
|
||||
# test leading binary comment
|
||||
"a"
|
||||
"b"
|
||||
)
|
||||
|
||||
(
|
||||
b + c + d + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
"bbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + "cccccccccccccccccccccccccc"
|
||||
"dddddddddddddddddddddddddd" % aaaaaaaaaaaa + x
|
||||
)
|
||||
|
||||
"a" "b" "c" + "d" "e" + "f" "g" + "h" "i" "j"
|
||||
|
||||
|
||||
class EC2REPATH:
|
||||
f.write("Pathway name" + "\t" "Database Identifier" + "\t" "Source database" + "\n")
|
||||
```
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue