-
Notifications
You must be signed in to change notification settings - Fork 880
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update black tests to psf/black@c369e44
- Loading branch information
Showing
8 changed files
with
137 additions
and
6 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
crates/ruff_python_formatter/resources/test/fixtures/black/miscellaneous/force_pyi.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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# flags: --pyi | ||
from typing import Union | ||
|
||
@bird | ||
|
1 change: 1 addition & 0 deletions
1
crates/ruff_python_formatter/resources/test/fixtures/black/miscellaneous/string_quotes.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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
'''''' | ||
|
||
'\'' | ||
'"' | ||
"'" | ||
|
1 change: 1 addition & 0 deletions
1
...ruff_python_formatter/resources/test/fixtures/black/miscellaneous/string_quotes.py.expect
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""""" | ||
|
||
"'" | ||
'"' | ||
"'" | ||
|
16 changes: 16 additions & 0 deletions
16
crates/ruff_python_formatter/resources/test/fixtures/black/raw_docstring.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,16 @@ | ||
# flags: --preview --skip-string-normalization | ||
class C: | ||
|
||
r"""Raw""" | ||
|
||
def f(): | ||
|
||
r"""Raw""" | ||
|
||
class SingleQuotes: | ||
|
||
|
||
r'''Raw''' | ||
|
||
class UpperCaseR: | ||
R"""Raw""" |
14 changes: 14 additions & 0 deletions
14
crates/ruff_python_formatter/resources/test/fixtures/black/raw_docstring.py.expect
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,14 @@ | ||
class C: | ||
r"""Raw""" | ||
|
||
|
||
def f(): | ||
r"""Raw""" | ||
|
||
|
||
class SingleQuotes: | ||
r'''Raw''' | ||
|
||
|
||
class UpperCaseR: | ||
R"""Raw""" |
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
92 changes: 92 additions & 0 deletions
92
crates/ruff_python_formatter/tests/snapshots/black_compatibility@raw_docstring.py.snap
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,92 @@ | ||
--- | ||
source: crates/ruff_python_formatter/tests/fixtures.rs | ||
input_file: crates/ruff_python_formatter/resources/test/fixtures/black/raw_docstring.py | ||
--- | ||
## Input | ||
|
||
```py | ||
# flags: --preview --skip-string-normalization | ||
class C: | ||
r"""Raw""" | ||
def f(): | ||
r"""Raw""" | ||
class SingleQuotes: | ||
r'''Raw''' | ||
class UpperCaseR: | ||
R"""Raw""" | ||
``` | ||
|
||
## Black Differences | ||
|
||
```diff | ||
--- Black | ||
+++ Ruff | ||
@@ -1,4 +1,6 @@ | ||
+# flags: --preview --skip-string-normalization | ||
class C: | ||
+ | ||
r"""Raw""" | ||
@@ -7,8 +9,9 @@ | ||
class SingleQuotes: | ||
- r'''Raw''' | ||
+ r"""Raw""" | ||
+ | ||
class UpperCaseR: | ||
R"""Raw""" | ||
``` | ||
|
||
## Ruff Output | ||
|
||
```py | ||
# flags: --preview --skip-string-normalization | ||
class C: | ||
r"""Raw""" | ||
def f(): | ||
r"""Raw""" | ||
class SingleQuotes: | ||
r"""Raw""" | ||
class UpperCaseR: | ||
R"""Raw""" | ||
``` | ||
|
||
## Black Output | ||
|
||
```py | ||
class C: | ||
r"""Raw""" | ||
def f(): | ||
r"""Raw""" | ||
class SingleQuotes: | ||
r'''Raw''' | ||
class UpperCaseR: | ||
R"""Raw""" | ||
``` | ||
|
||
|