black/tests/data/blackd_diff.diff
Rémi Verschelde 959848c176
Fix --diff output when encountering EOF (#1328)
`split("\n")` includes a final empty element `""` if the final line
ends with `\n` (as it should for POSIX-compliant text files), which
then became an extra `"\n"`.

`splitlines()` solves that, but there's a caveat, as it will split
on other types of line breaks too (like `\r`), which may not be
desired.

Fixes #526.
2020-04-04 22:02:57 -07:00

14 lines
255 B
Diff

--- [Deterministic header]
+++ [Deterministic header]
@@ -1,6 +1,5 @@
-def abc ():
- return ["hello", "world",
- "!"]
+def abc():
+ return ["hello", "world", "!"]
-print( "Incorrect formatting"
-)
+
+print("Incorrect formatting")