mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-03 21:24:29 +00:00
64 lines
946 B
Text
64 lines
946 B
Text
---
|
|
source: crates/ruff_python_formatter/tests/fixtures.rs
|
|
input_file: crates/ruff_python_formatter/resources/test/fixtures/black/simple_cases/fmtskip3.py
|
|
---
|
|
## Input
|
|
|
|
```py
|
|
a = 3
|
|
# fmt: off
|
|
b, c = 1, 2
|
|
d = 6 # fmt: skip
|
|
e = 5
|
|
# fmt: on
|
|
f = ["This is a very long line that should be formatted into a clearer line ", "by rearranging."]
|
|
```
|
|
|
|
## Black Differences
|
|
|
|
```diff
|
|
--- Black
|
|
+++ Ruff
|
|
@@ -1,7 +1,7 @@
|
|
a = 3
|
|
# fmt: off
|
|
-b, c = 1, 2
|
|
-d = 6 # fmt: skip
|
|
+b, c = 1, 2
|
|
+d = 6 # fmt: skip
|
|
e = 5
|
|
# fmt: on
|
|
f = [
|
|
```
|
|
|
|
## Ruff Output
|
|
|
|
```py
|
|
a = 3
|
|
# fmt: off
|
|
b, c = 1, 2
|
|
d = 6 # fmt: skip
|
|
e = 5
|
|
# fmt: on
|
|
f = [
|
|
"This is a very long line that should be formatted into a clearer line ",
|
|
"by rearranging.",
|
|
]
|
|
```
|
|
|
|
## Black Output
|
|
|
|
```py
|
|
a = 3
|
|
# fmt: off
|
|
b, c = 1, 2
|
|
d = 6 # fmt: skip
|
|
e = 5
|
|
# fmt: on
|
|
f = [
|
|
"This is a very long line that should be formatted into a clearer line ",
|
|
"by rearranging.",
|
|
]
|
|
```
|
|
|
|
|