Skip to content

Commit

Permalink
'Refactored by Sourcery'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sourcery AI authored and akaihola committed Sep 20, 2021
1 parent 10816fb commit 04efd21
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/darker/black_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,7 @@ def run_black(src_contents: TextDocument, black_config: BlackConfig) -> TextDocu
if contents_for_black.strip():
dst_contents = format_str(contents_for_black, mode=Mode(**mode))
else:
if "\n" in src_contents.string:
dst_contents = "\n"
else:
dst_contents = ""
dst_contents = "\n" if "\n" in src_contents.string else ""
return TextDocument.from_str(
dst_contents,
encoding=src_contents.encoding,
Expand Down

0 comments on commit 04efd21

Please sign in to comment.