summaryrefslogtreecommitdiff
path: root/src/rebar_prv_dialyzer.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebar_prv_dialyzer.erl')
-rw-r--r--src/rebar_prv_dialyzer.erl18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/rebar_prv_dialyzer.erl b/src/rebar_prv_dialyzer.erl
index ef14b81..7cf7e28 100644
--- a/src/rebar_prv_dialyzer.erl
+++ b/src/rebar_prv_dialyzer.erl
@@ -404,19 +404,12 @@ run_dialyzer(State, Opts, Output) ->
format_warnings(Output, Warnings) ->
Warnings1 = format_warnings(Warnings),
console_warnings(Warnings1),
- file_warnings(Output, Warnings1),
+ file_warnings(Output, Warnings),
length(Warnings1).
format_warnings(Warnings) ->
- [format_warning(Warning) || Warning <- Warnings].
-
-format_warning(Warning) ->
- case strip(dialyzer:format_warning(Warning, fullpath)) of
- ":0: " ++ Unknown ->
- Unknown;
- Warning1 ->
- Warning1
- end.
+ [rebar_dialyzer_format:format(Warning) || Warning <- Warnings].
+
console_warnings(Warnings) ->
_ = [?CONSOLE("~s", [Warning]) || Warning <- Warnings],
@@ -425,7 +418,7 @@ console_warnings(Warnings) ->
file_warnings(_, []) ->
ok;
file_warnings(Output, Warnings) ->
- Warnings1 = [[Warning, $\n] || Warning <- Warnings],
+ Warnings1 = [[dialyzer:format_warning(Warning, fullpath), $\n] || Warning <- Warnings],
case file:write_file(Output, Warnings1, [append]) of
ok ->
ok;
@@ -433,9 +426,6 @@ file_warnings(Output, Warnings) ->
throw({output_file_error, Output, Reason})
end.
-strip(Warning) ->
- string:strip(Warning, right, $\n).
-
no_warnings() ->
[no_return,
no_unused,