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