diff options
author | Hans Bolinder <[email protected]> | 2019-03-15 15:45:28 +0100 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2019-05-07 08:24:37 +0200 |
commit | b0a7495c44ebf6741714948bdf5c0cb9593ec953 (patch) | |
tree | 41293e782e3b08e26caf4f5634936b6ba84ec3a1 /lib/dialyzer/src/dialyzer.hrl | |
parent | a1e51d125944ad840a306d0cddec681848808f4c (diff) | |
download | otp-b0a7495c44ebf6741714948bdf5c0cb9593ec953.tar.gz otp-b0a7495c44ebf6741714948bdf5c0cb9593ec953.tar.bz2 otp-b0a7495c44ebf6741714948bdf5c0cb9593ec953.zip |
dialyzer: Add an --no_indentation option
By default Dialyzer tries to improve the readability of warnings.
Newlines are inserted before and inside types, signatures, and Erlang
code. Sometimes the newlines look misplaced. The raw format
(option --raw) is not affected.
Use the new --no_indentation option get the old behavior (no inserted
line breaks).
A note on the implementation. The types &c present in the warning
tuples are parsed, and then formatted using erl_pp, the Erlang Pretty
Printer. The alternative, to create message tuples with formatted
types, turned out to more complicated, and has no real benefits.
Also notice that the fixes for binaries (commit 9db8a098) and union
elements (commit a1e51d12) are required. As a consequence, messages
created before these commits using the --raw option cannot always be
indented.
Diffstat (limited to 'lib/dialyzer/src/dialyzer.hrl')
-rw-r--r-- | lib/dialyzer/src/dialyzer.hrl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/dialyzer/src/dialyzer.hrl b/lib/dialyzer/src/dialyzer.hrl index e7cf2860b7..4a12b9b671 100644 --- a/lib/dialyzer/src/dialyzer.hrl +++ b/lib/dialyzer/src/dialyzer.hrl @@ -108,6 +108,7 @@ -type dial_options() :: [dial_option()]. -type fopt() :: 'basename' | 'fullpath'. -type format() :: 'formatted' | 'raw'. +-type iopt() :: boolean(). -type label() :: non_neg_integer(). -type dial_warn_tags():: ordsets:ordset(dial_warn_tag()). -type rep_mode() :: 'quiet' | 'normal' | 'verbose'. @@ -119,6 +120,8 @@ %% Record declarations used by various files %%-------------------------------------------------------------------- +-define(INDENT_OPT, true). + -type doc_plt() :: 'undefined' | dialyzer_plt:plt(). -record(analysis, {analysis_pid :: pid() | 'undefined', @@ -154,6 +157,7 @@ output_file = none :: 'none' | file:filename(), output_format = formatted :: format(), filename_opt = basename :: fopt(), + indent_opt = ?INDENT_OPT :: iopt(), callgraph_file = "" :: file:filename(), check_plt = true :: boolean(), solvers = [] :: [solver()]}). |