aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMagnus Henoch <[email protected]>2013-03-26 12:54:16 +0000
committerMagnus Henoch <[email protected]>2013-03-26 14:08:44 +0000
commitb22ecf19e81baac844878afd896ebbdda4266a84 (patch)
tree619a00871ba9e2f6040578c43ef4ee0449ad51e9
parentda0355042254d98a06acddbf7361bd0f0f4b4f7f (diff)
downloadotp-b22ecf19e81baac844878afd896ebbdda4266a84.tar.gz
otp-b22ecf19e81baac844878afd896ebbdda4266a84.tar.bz2
otp-b22ecf19e81baac844878afd896ebbdda4266a84.zip
Improve Dialyzer output for scan errors
To reproduce, create an empty file "foo.erl" and run dialyzer on it. Results without this patch: $ dialyzer --src /tmp/foo.erl Checking whether the PLT /Users/magnus/.dialyzer_r16_plt is up-to-date... yes Proceeding with analysis... dialyzer: Analysis failed with error: Could not scan the following file(s): [{"/tmp/foo.erl", ["/tmp/foo.erl:1: no module definition\n"]}] Last messages in the log cache: Reading files and computing callgraph... Results with this patch: $ dialyzer --src /tmp/foo.erl Checking whether the PLT /Users/magnus/.dialyzer_r16_plt is up-to-date... yes Proceeding with analysis... dialyzer: Analysis failed with error: Could not scan the following file(s): /tmp/foo.erl:1: no module definition Last messages in the log cache: Reading files and computing callgraph...
-rw-r--r--lib/dialyzer/src/dialyzer_analysis_callgraph.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/dialyzer/src/dialyzer_analysis_callgraph.erl b/lib/dialyzer/src/dialyzer_analysis_callgraph.erl
index 86618a4915..ca6b403ac9 100644
--- a/lib/dialyzer/src/dialyzer_analysis_callgraph.erl
+++ b/lib/dialyzer/src/dialyzer_analysis_callgraph.erl
@@ -261,8 +261,8 @@ compile_and_store(Files, #analysis_state{codeserver = CServer,
dict:new(), NewFiles),
check_for_duplicate_modules(ModDict);
false ->
- Msg = io_lib:format("Could not scan the following file(s): ~p",
- [lists:flatten(Failed)]),
+ Msg = io_lib:format("Could not scan the following file(s):~n~s",
+ [[Reason || {_Filename, Reason} <- Failed]]),
exit({error, Msg})
end,
{T2, _} = statistics(runtime),