-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
158 additions
and
0 deletions.
There are no files selected for viewing
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
29 changes: 29 additions & 0 deletions
29
crates/ruff_python_formatter/resources/test/fixtures/black/simple_cases/delete.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,29 @@ | ||
x = 1 | ||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = 1 | ||
b, c, d = (2, 3, 4) | ||
|
||
# Some comment | ||
del x # Trailing comment | ||
# Dangling comment | ||
|
||
# Some comment | ||
del ( | ||
x, | ||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, | ||
b, | ||
c, | ||
d, | ||
) # Trailing comment | ||
# Dangling comment | ||
|
||
# Some comment | ||
del ( | ||
x, | ||
# Slapping one here | ||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, | ||
b, | ||
c, | ||
d | ||
# Another one | ||
) # Trailing comment | ||
# Dangling comment |
127 changes: 127 additions & 0 deletions
127
...f_python_formatter/src/snapshots/ruff_python_formatter__tests__black_test__delete_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,127 @@ | ||
--- | ||
source: crates/ruff_python_formatter/src/lib.rs | ||
expression: snapshot | ||
input_file: crates/ruff_python_formatter/resources/test/fixtures/black/simple_cases/delete.py | ||
--- | ||
## Input | ||
|
||
```py | ||
x = 1 | ||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = 1 | ||
b, c, d = (2, 3, 4) | ||
# Some comment | ||
del x # Trailing comment | ||
# Dangling comment | ||
# Some comment | ||
del x, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, b, c, d # Trailing comment | ||
# Dangling comment | ||
# Some comment | ||
del ( | ||
x, | ||
# Slapping one here | ||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, | ||
b, | ||
c, | ||
d | ||
# Another one | ||
) # Trailing comment | ||
# Dangling comment | ||
``` | ||
|
||
## Black Differences | ||
|
||
```diff | ||
--- Black | ||
+++ Ruff | ||
@@ -7,13 +7,7 @@ | ||
# Dangling comment | ||
# Some comment | ||
-del ( | ||
- x, | ||
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, | ||
- b, | ||
- c, | ||
- d, | ||
-) # Trailing comment | ||
+del x, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, b, c, d # Trailing comment | ||
# Dangling comment | ||
# Some comment | ||
@@ -23,7 +17,7 @@ | ||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, | ||
b, | ||
c, | ||
- d | ||
+ d, | ||
# Another one | ||
) # Trailing comment | ||
# Dangling comment | ||
``` | ||
|
||
## Ruff Output | ||
|
||
```py | ||
x = 1 | ||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = 1 | ||
b, c, d = (2, 3, 4) | ||
# Some comment | ||
del x # Trailing comment | ||
# Dangling comment | ||
# Some comment | ||
del x, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, b, c, d # Trailing comment | ||
# Dangling comment | ||
# Some comment | ||
del ( | ||
x, | ||
# Slapping one here | ||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, | ||
b, | ||
c, | ||
d, | ||
# Another one | ||
) # Trailing comment | ||
# Dangling comment | ||
``` | ||
|
||
## Black Output | ||
|
||
```py | ||
x = 1 | ||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = 1 | ||
b, c, d = (2, 3, 4) | ||
# Some comment | ||
del x # Trailing comment | ||
# Dangling comment | ||
# Some comment | ||
del ( | ||
x, | ||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, | ||
b, | ||
c, | ||
d, | ||
) # Trailing comment | ||
# Dangling comment | ||
# Some comment | ||
del ( | ||
x, | ||
# Slapping one here | ||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, | ||
b, | ||
c, | ||
d | ||
# Another one | ||
) # Trailing comment | ||
# Dangling comment | ||
``` | ||
|
||
|