-
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.
Add "preserve" quote-style to mimic Black's skip-string-normalization (…
…#8822) Co-authored-by: Micha Reiser <micha@reiser.io>
- Loading branch information
1 parent
6bbabce
commit 2414298
Showing
10 changed files
with
482 additions
and
96 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
crates/ruff_python_formatter/resources/test/fixtures/ruff/quote_style.options.json
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,11 @@ | ||
[ | ||
{ | ||
"quote_style": "single" | ||
}, | ||
{ | ||
"quote_style": "double" | ||
}, | ||
{ | ||
"quote_style": "preserve" | ||
} | ||
] |
50 changes: 50 additions & 0 deletions
50
crates/ruff_python_formatter/resources/test/fixtures/ruff/quote_style.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,50 @@ | ||
'single' | ||
"double" | ||
r'r single' | ||
r"r double" | ||
f'f single' | ||
f"f double" | ||
fr'fr single' | ||
fr"fr double" | ||
rf'rf single' | ||
rf"rf double" | ||
b'b single' | ||
b"b double" | ||
rb'rb single' | ||
rb"rb double" | ||
br'br single' | ||
br"br double" | ||
|
||
'''single triple''' | ||
"""double triple""" | ||
r'''r single triple''' | ||
r"""r double triple""" | ||
f'''f single triple''' | ||
f"""f double triple""" | ||
fr'''fr single triple''' | ||
fr"""fr double triple""" | ||
rf'''rf single triple''' | ||
rf"""rf double triple""" | ||
b'''b single triple''' | ||
b"""b double triple""" | ||
rb'''rb single triple''' | ||
rb"""rb double triple""" | ||
br'''br single triple''' | ||
br"""br double triple""" | ||
|
||
'single1' 'single2' | ||
'single1' "double2" | ||
"double1" 'single2' | ||
"double1" "double2" | ||
|
||
def docstring_single_triple(): | ||
'''single triple''' | ||
|
||
def docstring_double_triple(): | ||
"""double triple""" | ||
|
||
def docstring_double(): | ||
"double triple" | ||
|
||
def docstring_single(): | ||
'single' |
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.