summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2015-08-08 14:45:36 -0500
committerTristan Sloughter <t@crashfast.com>2015-08-08 14:45:36 -0500
commitecf6ad552444fa4e786bcd3959079033aff2ab7b (patch)
treeee030b66102d245094d450160e864a26d02bf6f6
parent6fde1748b9c7a67db1dbd1fb051d630c79656b3a (diff)
fix no_return warnings
-rw-r--r--src/rebar3.erl1
-rw-r--r--src/rebar_api.erl2
-rw-r--r--src/rebar_prv_update.erl7
-rw-r--r--src/rebar_utils.erl1
4 files changed, 10 insertions, 1 deletions
diff --git a/src/rebar3.erl b/src/rebar3.erl
index 46082f0..8004443 100644
--- a/src/rebar3.erl
+++ b/src/rebar3.erl
@@ -43,6 +43,7 @@
%% ====================================================================
%% escript Entry point
+-spec main(list()) -> no_return().
main(Args) ->
try run(Args) of
{ok, _State} ->
diff --git a/src/rebar_api.erl b/src/rebar_api.erl
index ec9f85e..6ebc500 100644
--- a/src/rebar_api.erl
+++ b/src/rebar_api.erl
@@ -21,10 +21,12 @@
%%%%%%%%%%%%%%%%%%%%%%%
%% @doc Interrupts program flow
+-spec abort() -> no_return().
abort() -> ?FAIL.
%% @doc like {@link error/2}, except it also raises an
%% exception to interrupt program flow.
+-spec abort(string(), list()) -> no_return().
abort(Str, Args) -> ?ABORT(Str, Args).
%% @doc Prints to the console, including a newline
diff --git a/src/rebar_prv_update.erl b/src/rebar_prv_update.erl
index 50ae2a0..049e78c 100644
--- a/src/rebar_prv_update.erl
+++ b/src/rebar_prv_update.erl
@@ -15,10 +15,15 @@
-define(PROVIDER, update).
-define(DEPS, []).
-%% Ignore warning of digraph opqaque type when running dialyzer
+%% Ignore warning of digraph opaque type when running dialyzer
-dialyzer({no_opaque, do/1}).
-dialyzer({no_opaque, write_registry/3}).
+%% Ignoring the opaque type warning won't stop dialyzer from warning of
+%% no return for functions that had the opaque type warnings
+-dialyzer({no_return, do/1}).
+-dialyzer({no_return, write_registry/3}).
+
%% ===================================================================
%% Public API
%% ===================================================================
diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl
index a61ae37..02a2262 100644
--- a/src/rebar_utils.erl
+++ b/src/rebar_utils.erl
@@ -510,6 +510,7 @@ log_msg_and_abort(Message) ->
?ABORT(Message, [])
end.
+-spec debug_log_msg_and_abort(string()) -> err_handler().
debug_log_msg_and_abort(Message) ->
fun(Command, {Rc, Output}) ->
?DEBUG("sh(~s)~n"