diff options
author | Tristan Sloughter <t@crashfast.com> | 2015-09-27 10:24:16 -0500 |
---|---|---|
committer | Tristan Sloughter <t@crashfast.com> | 2015-09-27 10:24:16 -0500 |
commit | 0839efda57d39469cc89c40b03814768f0d538e5 (patch) | |
tree | 9737d639acd3e64de93cdbc41eae5fc65faf7f2a /src | |
parent | f80dd6b88aea839e2a780bad858cb878eeff3df1 (diff) |
fix dialyzer warnings
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar3.erl | 1 | ||||
-rw-r--r-- | src/rebar_app_info.erl | 6 | ||||
-rw-r--r-- | src/rebar_dialyzer_format.erl | 9 | ||||
-rw-r--r-- | src/rebar_prv_local_install.erl | 2 |
4 files changed, 8 insertions, 10 deletions
diff --git a/src/rebar3.erl b/src/rebar3.erl index 9aad909..e55db71 100644 --- a/src/rebar3.erl +++ b/src/rebar3.erl @@ -45,6 +45,7 @@ %% For running with: %% erl +sbtu +A0 -noinput -mode minimal -boot start_clean -s rebar3 main -extra "$@" +-spec main() -> no_return(). main() -> List = init:get_plain_arguments(), main(List). diff --git a/src/rebar_app_info.erl b/src/rebar_app_info.erl index bb9f7a4..95b4624 100644 --- a/src/rebar_app_info.erl +++ b/src/rebar_app_info.erl @@ -83,7 +83,7 @@ dir :: file:name(), out_dir :: file:name(), resource_type :: pkg | src, - source :: string() | tuple() | undefined, + source :: string() | tuple() | checkout | undefined, is_lock=false :: boolean(), is_checkout=false :: boolean(), valid :: boolean()}). @@ -231,7 +231,7 @@ app_file_src(#app_info_t{app_file_src=undefined, dir=Dir, name=Name}) -> app_file_src(#app_info_t{app_file_src=AppFileSrc}) -> ec_cnv:to_list(AppFileSrc). --spec app_file_src(t(), file:filename_all()) -> t(). +-spec app_file_src(t(), file:filename_all() | undefined) -> t(). app_file_src(AppInfo=#app_info_t{}, undefined) -> AppInfo#app_info_t{app_file_src=undefined}; app_file_src(AppInfo=#app_info_t{}, AppFileSrc) -> @@ -369,7 +369,7 @@ resource_type(AppInfo=#app_info_t{}, Type) -> resource_type(#app_info_t{resource_type=ResourceType}) -> ResourceType. --spec source(t(), string() | tuple()) -> t(). +-spec source(t(), string() | tuple() | checkout) -> t(). source(AppInfo=#app_info_t{}, Source) -> AppInfo#app_info_t{source=Source}. diff --git a/src/rebar_dialyzer_format.erl b/src/rebar_dialyzer_format.erl index fbda8d0..0fd2b6e 100644 --- a/src/rebar_dialyzer_format.erl +++ b/src/rebar_dialyzer_format.erl @@ -31,12 +31,9 @@ fmt(Fmt, Args) -> format_warning({Tag, {File, Line, _MFA}, Msg}, FOpt) -> format_warning({Tag, {File, Line}, Msg}, FOpt); -format_warning({_Tag, {File, Line}, Msg}, FOpt) when is_list(File), - is_integer(Line) -> - F = case FOpt of - fullpath -> re:replace(File, "^.*/_build/", "_build/"); - basename -> filename:basename(File) - end, +format_warning({_Tag, {File, Line}, Msg}, fullpath) when is_list(File), + is_integer(Line) -> + F = re:replace(File, "^.*/_build/", "_build/"), String = lists:flatten(message_to_string(Msg)), lists:flatten(fmt("~s:~w~n~s", [F, Line, String])). diff --git a/src/rebar_prv_local_install.erl b/src/rebar_prv_local_install.erl index 172986d..65468a3 100644 --- a/src/rebar_prv_local_install.erl +++ b/src/rebar_prv_local_install.erl @@ -82,7 +82,7 @@ extract_escript(State, ScriptPath) -> {ok, #file_info{mode = _, uid = Uid, - gid = Gid}} = file:read_file_info(ScriptPath, [mode, uid, gid]), + gid = Gid}} = file:read_file_info(ScriptPath), ?INFO("Writing rebar3 run script ~s...", [BinFile]), file:write_file(BinFile, bin_contents(OutputDir)), |