Skip to content

Commit 05af8b8

Browse files
committed
Declare depth in formatter conf types for dialyzer
`translate_generic_conf/2` returns a map carrying a `depth` key, which the plaintext and JSON formatter translators merge into their results. The `formatter_plaintext_conf()` and `formatter_json_conf()` types do not declare `depth`, so dialyzer infers a return that violates the `translate_*_formatter_conf` contracts and reports "has no local return". Add `depth := unlimited | pos_integer()` to both types, matching the field already present on `formatter_generic_conf()`.
1 parent 448c8f2 commit 05af8b8

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

deps/rabbitmq_prelaunch/src/rabbit_prelaunch_early_logging.erl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ translate_generic_conf(Var, Conf) ->
285285
-type formatter_plaintext_conf() :: #{time_format := time_format(),
286286
level_format := level_format(),
287287
single_line := boolean(),
288+
depth := unlimited | pos_integer(),
288289
prefix_format := line_format(),
289290
line_format := line_format(),
290291
use_colors := boolean(),
@@ -414,6 +415,7 @@ translate_colors_conf(_, _) ->
414415
-type formatter_json_conf() :: #{time_format := time_format(),
415416
level_format := level_format(),
416417
single_line := boolean(),
418+
depth := unlimited | pos_integer(),
417419
field_map := json_field_map(),
418420
verbosity_map := json_verbosity_map()}.
419421

0 commit comments

Comments
 (0)