Procházet zdrojové kódy

Merge pull request #2351 from paulo-ferraz-oliveira/fix/dialyzer_warning_output_for_unknown

Fix `dialyzer` warning output for option `unknown`
pull/2357/head
Fred Hebert před 4 roky
odevzdal GitHub
rodič
revize
024ed3ce2e
V databázi nebyl nalezen žádný známý klíč pro tento podpis ID GPG klíče: 4AEE18F83AFDEB23
1 změnil soubory, kde provedl 15 přidání a 0 odebrání
  1. +15
    -0
      src/rebar_dialyzer_format.erl

+ 15
- 0
src/rebar_dialyzer_format.erl Zobrazit soubor

@ -27,6 +27,21 @@ format_warnings(Opts, Warnings) ->
%% If the last seen file is and the file of this warning are the same
%% `dialyzer_cl` returns _Filename = "", _Line = 0 for `unknown`
format_warning_(_Opts, Warning = {_Tag, {"" = _SrcFile0, 0 = Line}, Msg}, {_LastFile, Acc}) ->
SrcFile = "<path unknown>",
try
F = fmt("~!_c~ts", [SrcFile]),
String = message_to_string(Msg),
{SrcFile, [lists:flatten(fmt("~n~ts~n~!c~4w~!!: ~ts", [F, Line, String])) | Acc]}
catch
?WITH_STACKTRACE(Error, Reason, Stacktrace)
?DEBUG("Failed to pretty format warning: ~p:~p~n~p",
[Error, Reason, Stacktrace]),
{SrcFile, [dialyzer:format_warning(Warning, fullpath) | Acc]}
end;
%% we skip the file header
format_warning_(_Opts, Warning = {_Tag, {File, Line}, Msg}, {File, Acc}) ->
try

Načítá se…
Zrušit
Uložit