X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/a2b5ba2a3a97eb3a0b5130a5b317bb750c1624cf..6559bdbd9dcf71ba0017d66bb133c744bd83b0e3:/src/black/__init__.py diff --git a/src/black/__init__.py b/src/black/__init__.py index a985926..51384fb 100644 --- a/src/black/__init__.py +++ b/src/black/__init__.py @@ -328,6 +328,7 @@ def validate_regex( exists=True, file_okay=True, dir_okay=True, readable=True, allow_dash=True ), is_eager=True, + metavar="SRC ...", ) @click.option( "--config", @@ -803,7 +804,8 @@ def format_stdin_to_stdout( ) if write_back == WriteBack.YES: # Make sure there's a newline after the content - dst += "" if dst[-1] == "\n" else "\n" + if dst and dst[-1] != "\n": + dst += "\n" f.write(dst) elif write_back in (WriteBack.DIFF, WriteBack.COLOR_DIFF): now = datetime.utcnow()