Skip to content

Commit 284a5f7

Browse files
committed
Change mix format to skip empty .ex and .exs files
1 parent bd49ad6 commit 284a5f7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ defmodule Mix.Tasks.Format do
561561

562562
defp format_file({file, formatter}, task_opts) do
563563
input = read_file(file)
564-
output = formatter.(input)
564+
output = (bit_size(input) > 0 && formatter.(input)) || <<>>
565565
check_formatted? = Keyword.get(task_opts, :check_formatted, false)
566566
dry_run? = Keyword.get(task_opts, :dry_run, false)
567567

0 commit comments

Comments
 (0)