rebar3 icon indicating copy to clipboard operation
rebar3 copied to clipboard

Dialyzer formatting

Open tsloughter opened this issue 1 month ago • 0 comments

This tweet about Typescript formatting https://x.com/t3dotgg/status/1796646449960390768 had me wondering if we could do the same for dialyzer. I've at times had to copy blocks of dialyzer warnings to an editor to break it up to be able to read.

@michalmuskala says https://github.com/jeremyjh/dialyxir does this, so it might be a good place to start looking for anyone interested in picking this up.

@ferd did great work on compilation errors, so that is also a good place to start, https://github.com/erlang/rebar3/pull/2783

Line 49 Column 2: Invalid type specification for function otel_tracer:start_span/3. The success typing is ({_,_},_,_) -> any() but the spec is (integer(),opentelemetry:span_name(),otel_span:start_opts()) -> opentelemetry:span_ctx()
Line 49 Column 2: Invalid type specification for function otel_tracer:start_span/3. 

Type spec:

(integer(),opentelemetry:span_name(),otel_span:start_opts()) -> opentelemetry:span_ctx()

Does not match success type:

({_, _}, _, _) -> any() 

Something as simple as that may make it quicker to see the issue is the first argument should be {_, _} even though a diff of the two would give nothing being equivalent, so hard to tell at first glance where the wrong piece is.

A better example is when there are multiple large record or map mismatches.

tsloughter avatar Jun 04 '24 09:06 tsloughter