   end
 
   @doc false
-  @spec text_diff_format(String.t(), String.t(), keyword()) :: iolist()
-  def text_diff_format(code, code, opts \\ default_opts())
+  @spec text_diff_format(String.t(), String.t()) :: iolist()
+  def text_diff_format(old, new, opts \\ [])
 
   def text_diff_format(code, code, _opts), do: []
 
   def text_diff_format(old, new, opts) do
-    opts = Keyword.merge(@default_opts, opts)
-
+    opts = Keyword.validate!(opts, after: 2, before: 2, color: IO.ANSI.enabled?(), line: 1)
     crs? = String.contains?(old, "\r") || String.contains?(new, "\r")
 
     old = String.split(old, "\n")

    |> insert_cr_symbols(crs?)
    |> diff_to_iodata({line, line}, opts)
  end

  @doc false
  @spec default_opts() :: keyword()
  def default_opts, do: @default_opts

  defp diff_to_iodata(diff, line_nums, opts, iodata \\ [])



      {file, unformatted, formatted} ->
        [
          IO.ANSI.bright(),
          IO.ANSI.red(),
          file,
          "\n",
