Skip to content

Commit a140342

Browse files
author
Matthias Radestock
committed
cosmetic
1 parent 94b28a4 commit a140342

File tree

1 file changed

+19
-27
lines changed

1 file changed

+19
-27
lines changed

src/rabbit_dialyzer.erl

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -48,50 +48,42 @@
4848
%%----------------------------------------------------------------------------
4949

5050
create_basic_plt(BasicPltPath) ->
51-
OptsRecord = dialyzer_options:build([
52-
{analysis_type, plt_build},
53-
{output_plt, BasicPltPath},
54-
{files_rec, otp_apps_dependencies_paths()}]),
51+
OptsRecord = dialyzer_options:build(
52+
[{analysis_type, plt_build},
53+
{output_plt, BasicPltPath},
54+
{files_rec, otp_apps_dependencies_paths()}]),
5555
dialyzer_cl:start(OptsRecord),
5656
ok.
5757

5858
add_to_plt(PltPath, FilesString) ->
5959
{ok, Files} = regexp:split(FilesString, " "),
60-
DialyzerWarnings = dialyzer:run([
61-
{analysis_type, plt_add},
62-
{init_plt, PltPath},
63-
{output_plt, PltPath},
64-
{files, Files}]),
60+
DialyzerWarnings = dialyzer:run([{analysis_type, plt_add},
61+
{init_plt, PltPath},
62+
{output_plt, PltPath},
63+
{files, Files}]),
6564
print_warnings(DialyzerWarnings),
6665
ok.
6766

6867
dialyze_files(PltPath, ModifiedFiles) ->
6968
{ok, Files} = regexp:split(ModifiedFiles, " "),
70-
DialyzerWarnings = dialyzer:run([
71-
{init_plt, PltPath},
72-
{files, Files}]),
69+
DialyzerWarnings = dialyzer:run([{init_plt, PltPath},
70+
{files, Files}]),
7371
case DialyzerWarnings of
74-
[] ->
75-
io:format("Ok, dialyzer returned no warnings.~n", []),
76-
ok;
77-
_ ->
78-
io:format("~nFAILED! dialyzer returned the following warnings:~n", []),
79-
print_warnings(DialyzerWarnings),
80-
fail
72+
[] -> io:format("~nOk~n"),
73+
ok;
74+
_ -> io:format("~nFAILED with the following warnings:~n"),
75+
print_warnings(DialyzerWarnings),
76+
fail
8177
end.
8278

83-
print_warnings(DialyzerWarnings) ->
84-
lists:foreach(
85-
fun
86-
(Warning) -> io:format("~s", [dialyzer:format_warning(Warning)])
87-
end,
88-
DialyzerWarnings),
89-
io:format("~n", []),
79+
print_warnings(Warnings) ->
80+
[io:format("~s", [dialyzer:format_warning(W)]) || W <- Warnings],
81+
io:format("~n"),
9082
ok.
9183

9284
otp_apps_dependencies_paths() ->
9385
[code:lib_dir(App, ebin) ||
94-
App <- [stdlib, kernel, mnesia, os_mon, ssl, eunit, tools, sasl]].
86+
App <- [kernel, stdlib, sasl, mnesia, os_mon, ssl, eunit, tools]].
9587

9688
halt_with_code(ok) ->
9789
halt();

0 commit comments

Comments
 (0)