summaryrefslogtreecommitdiff
path: root/src/rebar_dialyzer.erl
diff options
context:
space:
mode:
authorAlexey Romanov <alexey.v.romanov@gmail.com>2011-02-21 12:41:20 +0300
committerAlexey Romanov <alexey.v.romanov@gmail.com>2011-02-21 12:41:20 +0300
commit7dc371d8a3b9a6e2ab9f814c0d2536cf638ceb99 (patch)
tree174193ae08d2824164ba99e63f696a6593ee63c6 /src/rebar_dialyzer.erl
parent2ceeb3272139b7569c8dabc215ca1e7063b0d385 (diff)
parent6056c63eed288736c912c82d6f36aa7dd055f9ca (diff)
Merge branch 'master' of https://github.com/basho/rebar
Diffstat (limited to 'src/rebar_dialyzer.erl')
-rw-r--r--src/rebar_dialyzer.erl40
1 files changed, 22 insertions, 18 deletions
diff --git a/src/rebar_dialyzer.erl b/src/rebar_dialyzer.erl
index 9d45445..c3e3c36 100644
--- a/src/rebar_dialyzer.erl
+++ b/src/rebar_dialyzer.erl
@@ -1,4 +1,4 @@
-%% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*-
+%% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ts=4 sw=4 et
%% -------------------------------------------------------------------
%%
@@ -31,15 +31,19 @@
%% <li>build-plt (essentially "dialyzer --build_plt -r &lt;app_dirs&gt;")</li>
%% <li>check-plt (essentially "dialyzer --check_plt")</li>
%% </ul>
-%% A single option <code>plt</code> can be presented in the <code>dialyzer_opts</code>
-%% options in <code>rebar.config</code>. If it is present, it is used as the PLT for the
-%% supported commands. Should it not be present, then the default is <code>$HOME/.dialyzer_plt</code>.
-%% @reference <a href="http://user.it.uu.se/~kostis/Papers/bugs05.pdf">Experience from developing the Dialyzer:
-%% A static analysis tool detecting defects in Erlang applications</a>
-%% @reference <a href="http://user.it.uu.se/~kostis/Papers/contracts.pdf">A Language for Specifying Type
-%% Contracts in Erlang and its Interaction with Success Typings</a>
-%% @reference <a href="http://user.it.uu.se/~kostis/Papers/wrangler.pdf">Gradual Typing of Erlang
-%% Programs: A Wrangler Experience</a>
+%% A single option <code>plt</code> can be presented in the
+%% <code>dialyzer_opts</code> options in <code>rebar.config</code>. If it
+%% is present, it is used as the PLT for the supported commands. Should it
+%% not be present, then the default is <code>$HOME/.dialyzer_plt</code>.
+%%
+%% @reference <a href="http://user.it.uu.se/~kostis/Papers/bugs05.pdf">
+%% Experience from developing the Dialyzer: A static analysis tool detecting
+%% defects in Erlang applications</a>
+%% @reference <a href="http://user.it.uu.se/~kostis/Papers/contracts.pdf">
+%% A Language for Specifying Type Contracts in Erlang and its Interaction
+%% with Success Typings</a>
+%% @reference <a href="http://user.it.uu.se/~kostis/Papers/wrangler.pdf">Gradual
+%% Typing of Erlang Programs: A Wrangler Experience</a>
%% @copyright 2010 Dave Smith
%% -------------------------------------------------------------------
-module(rebar_dialyzer).
@@ -67,12 +71,12 @@ dialyze(Config, File) ->
dialyzer_opts,
[])),
DialyzerOpts0 = case FromSrc of
- true ->
- [{files_rec, ["src"]}, {init_plt, Plt},
- {from, src_code}];
- false ->
- [{files_rec, ["ebin"]}, {init_plt, Plt}]
- end,
+ true ->
+ [{files_rec, ["src"]}, {init_plt, Plt},
+ {from, src_code}];
+ false ->
+ [{files_rec, ["ebin"]}, {init_plt, Plt}]
+ end,
WarnOpts = warnings(Config),
DialyzerOpts = case WarnOpts of
[] -> DialyzerOpts0;
@@ -150,7 +154,7 @@ app_dirs(Apps) ->
-spec output_warnings(Warnings::[warning()]) -> 'ok'.
output_warnings(Warnings) ->
lists:foreach(fun(Warning) ->
- ?CONSOLE("~s", [dialyzer:format_warning(Warning)])
+ ?CONSOLE("~s", [dialyzer:format_warning(Warning)])
end, Warnings).
%% @doc If the plt option is present in rebar.config return its value, otherwise
@@ -193,7 +197,7 @@ existing_plt_path(Config, File) ->
?ABORT("No PLT found~n", [])
end
end;
- [$~|[$/|Plt]] ->
+ "~/" ++ Plt ->
filename:join(Home,Plt);
Plt ->
Plt