mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 18:28:24 +00:00
Fix joining of f-strings with different quotes when using quote style Preserve
(#15524)
This commit is contained in:
parent
fc9dd63d64
commit
420365811f
3 changed files with 55 additions and 11 deletions
|
@ -11,3 +11,12 @@ a = "different '" 'quote "are fine"' # join
|
|||
|
||||
# Already invalid Pre Python 312
|
||||
f"{'Hy "User"'}" f'{"Hy 'User'"}'
|
||||
|
||||
|
||||
# Regression tests for https://github.com/astral-sh/ruff/issues/15514
|
||||
params = {}
|
||||
string = "this is my string with " f'"{params.get("mine")}"'
|
||||
string = f'"{params.get("mine")} ' f"with {'nested single quoted string'}"
|
||||
string = f"{'''inner ' '''}" f'{"""inner " """}'
|
||||
string = f"{10 + len('bar')=}" f"{10 + len('bar')=}"
|
||||
string = f"{10 + len('bar')=}" f'{10 + len("bar")=}'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue