ruff/crates/ruff_python_formatter/tests/snapshots/black_compatibility@fmtskip5.py.snap
konstin 7f6cb9dfb5
Format call expressions (without call chaining) (#5341)
## Summary

This formats call expressions with magic trailing comma and parentheses
behaviour but without call chaining

## Test Plan

Lots of new test fixtures, including some that don't work yet
2023-06-27 09:29:40 +00:00

65 lines
890 B
Text

---
source: crates/ruff_python_formatter/tests/fixtures.rs
input_file: crates/ruff_python_formatter/resources/test/fixtures/black/simple_cases/fmtskip5.py
---
## Input
```py
a, b, c = 3, 4, 5
if (
a == 3
and b != 9 # fmt: skip
and c is not None
):
print("I'm good!")
else:
print("I'm bad")
```
## Black Differences
```diff
--- Black
+++ Ruff
@@ -1,7 +1,8 @@
a, b, c = 3, 4, 5
if (
a == 3
- and b != 9 # fmt: skip
+ and b
+ != 9 # fmt: skip
and c is not None
):
print("I'm good!")
```
## Ruff Output
```py
a, b, c = 3, 4, 5
if (
a == 3
and b
!= 9 # fmt: skip
and c is not None
):
print("I'm good!")
else:
print("I'm bad")
```
## Black Output
```py
a, b, c = 3, 4, 5
if (
a == 3
and b != 9 # fmt: skip
and c is not None
):
print("I'm good!")
else:
print("I'm bad")
```