 
 defmodule RandomFile do
   @pattern "lib/*/{lib,unicode,test}/**/*.{ex,exs}"
+
+  def run(["--stat"]) do
+    files = Path.wildcard(@pattern)
+    {opts, _} = Code.eval_file(".formatter.exs")
+    formatted = Enum.filter(files, &formatted?(&1, opts))
+    IO.puts "#{length(formatted)} out of #{length(files)} files formatted"
+  end
 
   def run(args) do
     popper =

      """)
    end
  end
end

RandomFile.run(System.argv())


  defp random_file(collection, popper, opts) do
    {file, collection} = popper.(collection)
    IO.write("Checking #{file}... ")

    if formatted?(file, opts) do
      IO.puts("already formatted.")
      random_file(collection, popper, opts)
    else
