Przeglądaj źródła

Merge pull request #841 from tsloughter/dialyzer_warnings

fix dialyzer warnings
pull/854/head
Tristan Sloughter 9 lat temu
rodzic
commit
cf78543991
4 zmienionych plików z 8 dodań i 10 usunięć
  1. +1
    -0
      src/rebar3.erl
  2. +3
    -3
      src/rebar_app_info.erl
  3. +3
    -6
      src/rebar_dialyzer_format.erl
  4. +1
    -1
      src/rebar_prv_local_install.erl

+ 1
- 0
src/rebar3.erl Wyświetl plik

@ -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).

+ 3
- 3
src/rebar_app_info.erl Wyświetl plik

@ -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}.

+ 3
- 6
src/rebar_dialyzer_format.erl Wyświetl plik

@ -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])).

+ 1
- 1
src/rebar_prv_local_install.erl Wyświetl plik

@ -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)),

Ładowanie…
Anuluj
Zapisz