mirror of https://github.com/astral-sh/ruff
87 lines
811 B
Plaintext
87 lines
811 B
Plaintext
---
|
|
source: crates/ruff_python_formatter/tests/fixtures.rs
|
|
input_file: crates/ruff_python_formatter/resources/test/fixtures/black/simple_cases/fmtonoff3.py
|
|
---
|
|
## Input
|
|
|
|
```py
|
|
# fmt: off
|
|
x = [
|
|
1, 2,
|
|
3, 4,
|
|
]
|
|
# fmt: on
|
|
|
|
# fmt: off
|
|
x = [
|
|
1, 2,
|
|
3, 4,
|
|
]
|
|
# fmt: on
|
|
|
|
x = [
|
|
1, 2, 3, 4
|
|
]
|
|
```
|
|
|
|
## Black Differences
|
|
|
|
```diff
|
|
--- Black
|
|
+++ Ruff
|
|
@@ -1,15 +1,9 @@
|
|
# fmt: off
|
|
-x = [
|
|
- 1, 2,
|
|
- 3, 4,
|
|
-]
|
|
+x = [1, 2, 3, 4]
|
|
# fmt: on
|
|
|
|
# fmt: off
|
|
-x = [
|
|
- 1, 2,
|
|
- 3, 4,
|
|
-]
|
|
+x = [1, 2, 3, 4]
|
|
# fmt: on
|
|
|
|
x = [1, 2, 3, 4]
|
|
```
|
|
|
|
## Ruff Output
|
|
|
|
```py
|
|
# fmt: off
|
|
x = [1, 2, 3, 4]
|
|
# fmt: on
|
|
|
|
# fmt: off
|
|
x = [1, 2, 3, 4]
|
|
# fmt: on
|
|
|
|
x = [1, 2, 3, 4]
|
|
```
|
|
|
|
## Black Output
|
|
|
|
```py
|
|
# fmt: off
|
|
x = [
|
|
1, 2,
|
|
3, 4,
|
|
]
|
|
# fmt: on
|
|
|
|
# fmt: off
|
|
x = [
|
|
1, 2,
|
|
3, 4,
|
|
]
|
|
# fmt: on
|
|
|
|
x = [1, 2, 3, 4]
|
|
```
|
|
|
|
|