dialyzer.ex (624B)
1 defmodule Dialyxir.Formatter.Dialyzer do 2 @moduledoc false 3 4 @behaviour Dialyxir.Formatter 5 6 @impl Dialyxir.Formatter 7 def format(warning) do 8 # OTP 22 uses indented output, but that's incompatible with dialyzer.ignore-warnings format. 9 # Can be disabled, but OTP 21 and older only accept an atom, so only disable on OTP 22+. 10 opts = 11 if String.to_integer(System.otp_release()) < 22, 12 do: :fullpath, 13 else: [{:filename_opt, :fullpath}, {:indent_opt, false}] 14 15 warning 16 |> :dialyzer.format_warning(opts) 17 |> String.Chars.to_string() 18 |> String.replace_trailing("\n", "") 19 end 20 end