jeremyjh / dialyxir

Mix tasks to simplify use of Dialyzer in Elixir projects.
Apache License 2.0
1.69k stars 141 forks source link

How to pass options --statistics, --verbose, and --get_warnings to Dialyzer #482

Open paulo-ferraz-oliveira opened 1 year ago

paulo-ferraz-oliveira commented 1 year ago

Precheck

Searched issues, and README, for:

Locally using:

Environment

Erlang/OTP 25 [erts-13.1.4] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit]

Elixir 1.14.3 (compiled with Erlang/OTP 25)

"dialyxir": {:hex, :dialyxir, "1.2.0", "58344b3e87c2e7095304c81a9ae65cb68b613e28340690dfe1a5597fd08dec37", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "61072136427a851674cab81762be4dbeae7679f85b1272b6d25c3a839aff8463"},

Current behavior

I can't seem to find a way to pass the following Dialyzer options to it and recover their output (i.e. even if they're being passed from e.g. mix dialyzer --statistics ... I'm not getting the output):

Expected behavior

I'd like to understand if passing those options is possible in the current version (as I may be doing something wrong) and, if it's not, if it would be desired. This issue would serve as a reference for the desire, which I could also pull request for, if/when time allows.

jeremyjh commented 1 year ago

Hi, yes those are unsupported. I do not know how they work or where they are implemented in dialyzer, but it may be important to know that we are not invoking the dialyzer CLI tool, we're using the API. So we can't just pass through inputs and outputs, we'd have to implement those in the API and do something appropriate with the output it generates.

paulo-ferraz-oliveira commented 1 year ago

Hey, @jeremyjh.

Thanks for your feedback. Yeah, I noticed (looking at the mix task) you weren't using the CLI tool; I just didn't remember to check if those we're part of the API, though, sorry!

Shall we keep this open, while I create an equivalent to this for Erlang/OTP: Dialyzer?

Thanks.

Edit: Erlang/OTP issue #7007 - dialyzer: expose options --statistics, --verbose, and --get_warnings on the API 😄

jeremyjh commented 1 year ago

Yes I am fine to keep it open.