|
48 | 48 | %%---------------------------------------------------------------------------- |
49 | 49 |
|
50 | 50 | 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()}]), |
55 | 55 | dialyzer_cl:start(OptsRecord), |
56 | 56 | ok. |
57 | 57 |
|
58 | 58 | add_to_plt(PltPath, FilesString) -> |
59 | 59 | {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}]), |
65 | 64 | print_warnings(DialyzerWarnings), |
66 | 65 | ok. |
67 | 66 |
|
68 | 67 | dialyze_files(PltPath, ModifiedFiles) -> |
69 | 68 | {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}]), |
73 | 71 | 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 |
81 | 77 | end. |
82 | 78 |
|
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"), |
90 | 82 | ok. |
91 | 83 |
|
92 | 84 | otp_apps_dependencies_paths() -> |
93 | 85 | [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]]. |
95 | 87 |
|
96 | 88 | halt_with_code(ok) -> |
97 | 89 | halt(); |
|
0 commit comments