Skip to content

Commit

Permalink
Use black fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
cnpryer committed Jun 18, 2023
1 parent faf23c3 commit bed3598
Show file tree
Hide file tree
Showing 3 changed files with 158 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
# Some comment
del (
x,
# Slapping one here
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
b,
c,
d
# Another one
) # Trailing comment
# Dangling comment
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
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
```


0 comments on commit bed3598

Please sign in to comment.