Dialyxir.Warning behaviour (Dialyxir v1.4.8)

Copy Markdown View Source

Behaviour for defining warning semantics.

Contains callbacks for various warnings

Summary

Callbacks

Explanation for a warning of this type. Should include a simple example of how to trigger it.

The default documentation when seeing an error without the user otherwise overriding the format.

A short message, often missing things like success types and expected types for space.

By expressing the warning that is to be matched on, error handling and dispatching can be avoided in format functions.

Callbacks

explain()

@callback explain() :: String.t()

Explanation for a warning of this type. Should include a simple example of how to trigger it.

format_long(arg1)

@callback format_long([String.t()] | {String.t(), String.t(), String.t()} | String.t()) ::
  String.t()

The default documentation when seeing an error without the user otherwise overriding the format.

format_short(arg1)

@callback format_short([String.t()] | {String.t(), String.t(), String.t()} | String.t()) ::
  String.t()

A short message, often missing things like success types and expected types for space.

warning()

@callback warning() :: atom()

By expressing the warning that is to be matched on, error handling and dispatching can be avoided in format functions.

Functions

default_explain()

@spec default_explain() :: String.t()