Skip to content

Commit 29c6cae

Browse files
committed
Do not format empty lines into line breaks
1 parent 5d0519c commit 29c6cae

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/mix/lib/mix/tasks/format.ex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,8 @@ defmodule Mix.Tasks.Format do
544544
defp stdin_or_wildcard("-"), do: [:stdin]
545545
defp stdin_or_wildcard(path), do: path |> Path.expand() |> Path.wildcard(match_dot: true)
546546

547+
defp elixir_format("", _formatter_opts), do: ""
548+
547549
defp elixir_format(content, formatter_opts) do
548550
IO.iodata_to_binary([Code.format_string!(content, formatter_opts), ?\n])
549551
end

0 commit comments

Comments
 (0)