Normalize implicit concatenated f-string quotes per part (#13539)

This commit is contained in:
Micha Reiser 2024-10-08 11:59:17 +02:00 committed by GitHub
parent 42fcbef876
commit fc661e193a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 171 additions and 62 deletions

View file

@ -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."
)
```