zf

zenflows testing
git clone https://s.sonu.ch/~srfsh/zf.git
Log | Files | Refs | Submodules | README | LICENSE

callback_info_missing.ex (946B)


      1 defmodule Dialyxir.Warnings.CallbackInfoMissing do
      2   @moduledoc """
      3   The module is using a behaviour that does not exist or is not a
      4   behaviour. This is also a compiler warning.
      5 
      6   ## Example
      7 
      8       defmodule Example do
      9         @behaviour BehaviourThatDoesNotExist
     10 
     11         def ok() do
     12           :ok
     13         end
     14       end
     15   """
     16 
     17   @behaviour Dialyxir.Warning
     18 
     19   @impl Dialyxir.Warning
     20   @spec warning() :: :callback_info_missing
     21   def warning(), do: :callback_info_missing
     22 
     23   @impl Dialyxir.Warning
     24   @spec format_short([String.t()]) :: String.t()
     25   def format_short(args), do: format_long(args)
     26 
     27   @impl Dialyxir.Warning
     28   @spec format_long([String.t()]) :: String.t()
     29   def format_long([behaviour]) do
     30     pretty_behaviour = Erlex.pretty_print(behaviour)
     31 
     32     "Callback info about the #{pretty_behaviour} behaviour is not available."
     33   end
     34 
     35   @impl Dialyxir.Warning
     36   @spec explain() :: String.t()
     37   def explain() do
     38     @moduledoc
     39   end
     40 end