zf

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

race_condition.ex (776B)


      1 defmodule Dialyxir.Warnings.RaceCondition do
      2   @behaviour Dialyxir.Warning
      3 
      4   @impl Dialyxir.Warning
      5   @spec warning() :: :race_condition
      6   def warning(), do: :race_condition
      7 
      8   @impl Dialyxir.Warning
      9   @spec format_short([String.t()]) :: String.t()
     10   def format_short([_module, function | _]) do
     11     "Possible race condition in #{function}."
     12   end
     13 
     14   @impl Dialyxir.Warning
     15   @spec format_long([String.t()]) :: String.t()
     16   def format_long([module, function, args, reason]) do
     17     pretty_args = Erlex.pretty_print_args(args)
     18     pretty_module = Erlex.pretty_print(module)
     19 
     20     "The call #{pretty_module}, #{function}#{pretty_args} #{reason}."
     21   end
     22 
     23   @impl Dialyxir.Warning
     24   @spec explain() :: String.t()
     25   def explain() do
     26     Dialyxir.Warning.default_explain()
     27   end
     28 end