-
-
Notifications
You must be signed in to change notification settings - Fork 97
Expand file tree
/
Copy pathmix_dialyzer.exs
More file actions
27 lines (23 loc) · 715 Bytes
/
mix_dialyzer.exs
File metadata and controls
27 lines (23 loc) · 715 Bytes
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
defmodule Mix.Dialyzer do
def dependency do
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false, optional: true}
end
def config(opts \\ []) do
add_apps = [:compiler, :ex_unit, :mix, :wx | Keyword.get(opts, :add_apps, [])]
[
plt_core_path: absolute_path("priv/plts"),
plt_file: {:no_warn, absolute_path("priv/plts/#{plt_name()}.plt")},
plt_add_deps: :apps_direct,
plt_add_apps: add_apps,
ignore_warnings: absolute_path("dialyzer.ignore-warnings")
]
end
def absolute_path(relative_path) do
__ENV__.file
|> Path.dirname()
|> Path.join(relative_path)
end
defp plt_name do
File.cwd!() |> Path.basename() |> String.to_atom()
end
end