浏览代码

fix no_return warnings

pull/696/head
Tristan Sloughter 9 年前
父节点
当前提交
ecf6ad5524
共有 4 个文件被更改,包括 10 次插入1 次删除
  1. +1
    -0
      src/rebar3.erl
  2. +2
    -0
      src/rebar_api.erl
  3. +6
    -1
      src/rebar_prv_update.erl
  4. +1
    -0
      src/rebar_utils.erl

+ 1
- 0
src/rebar3.erl 查看文件

@ -43,6 +43,7 @@
%% ====================================================================
%% escript Entry point
-spec main(list()) -> no_return().
main(Args) ->
try run(Args) of
{ok, _State} ->

+ 2
- 0
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

+ 6
- 1
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
%% ===================================================================

+ 1
- 0
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"

正在加载...
取消
保存