mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 02:39:12 +00:00
Normalize implicit concatenated f-string quotes per part (#13539)
This commit is contained in:
parent
42fcbef876
commit
fc661e193a
11 changed files with 171 additions and 62 deletions
|
@ -313,6 +313,14 @@ hello {
|
|||
]
|
||||
} --------
|
||||
"""
|
||||
|
||||
|
||||
# Implicit concatenated f-string containing quotes
|
||||
_ = (
|
||||
'This string should change its quotes to double quotes'
|
||||
f'This string uses double quotes in an expression {"woah"}'
|
||||
f'This f-string does not use any quotes.'
|
||||
)
|
||||
```
|
||||
|
||||
## Outputs
|
||||
|
@ -649,6 +657,14 @@ hello {
|
|||
]
|
||||
} --------
|
||||
"""
|
||||
|
||||
|
||||
# Implicit concatenated f-string containing quotes
|
||||
_ = (
|
||||
"This string should change its quotes to double quotes"
|
||||
f'This string uses double quotes in an expression {"woah"}'
|
||||
f"This f-string does not use any quotes."
|
||||
)
|
||||
```
|
||||
|
||||
|
||||
|
@ -973,6 +989,14 @@ hello {
|
|||
]
|
||||
} --------
|
||||
"""
|
||||
|
||||
|
||||
# Implicit concatenated f-string containing quotes
|
||||
_ = (
|
||||
'This string should change its quotes to double quotes'
|
||||
f'This string uses double quotes in an expression {"woah"}'
|
||||
f'This f-string does not use any quotes.'
|
||||
)
|
||||
```
|
||||
|
||||
|
||||
|
@ -1279,7 +1303,7 @@ hello {
|
|||
# comment 27
|
||||
# comment 28
|
||||
} woah {x}"
|
||||
@@ -287,19 +299,19 @@
|
||||
@@ -287,27 +299,27 @@
|
||||
if indent2:
|
||||
foo = f"""hello world
|
||||
hello {
|
||||
|
@ -1314,4 +1338,14 @@ hello {
|
|||
+ ]
|
||||
+ } --------
|
||||
"""
|
||||
|
||||
|
||||
# Implicit concatenated f-string containing quotes
|
||||
_ = (
|
||||
- 'This string should change its quotes to double quotes'
|
||||
+ "This string should change its quotes to double quotes"
|
||||
f'This string uses double quotes in an expression {"woah"}'
|
||||
- f'This f-string does not use any quotes.'
|
||||
+ f"This f-string does not use any quotes."
|
||||
)
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue