jeremyjh

jeremyjh

Dialyxir Pretty Printing: All your errors are belong to us (please)!

Hi everyone,

Andrew Summers has been working on a feature for dialyxir that among other things will Elixirfy the Erlang term representations - in particular this will improve the readability of structs in dialyzer warnings. It also gives us the ability to tweak or expand on the wording of the messages.

Ideally we’d have a test suite based on a corpus of real-world warning messages - but that doesn’t really exist to my knowledge. This is at the point though that alpha testing would be helpful to identify cases where types are not parsed when they could be or fail when attempted.

If you’d like to help out, and your project is already using Elixir 1.6 (we rely on this to help with pretty printing) you can update your mix.exs to use this branch:

{:dialyxir, git: "https://github.com/jeremyjh/dialyxir", branch: "elixir-formatter", runtime: false}

If parsing fails with an exception dialyxir should automatically print the message using :dialyzer formatter (like it the released version does today). If that happens please post about it in the PR.

Also there is a new command line option --raw - if you see output that you think doesn’t look good or doesn’t parse things that want for parsing, please re-run with mix dialyzer --raw and post the output tuples to that PR.

Thanks in advance!

Most Liked

jeremyjh

jeremyjh

This feature has merged to master - I really want to thank Andrew for all the work he’s put into this.

Also, I wanted to mention another feature Andrew added, which is --explain - this contains help text about what the class of warning means. So mix dialyzer --explain no_return will now do exactly that. Suggestions / improvements to this learning resource would be greatly appreciated.

14
Post #2
jeremyjh

jeremyjh

I’ve published a release candidate to hex:

  {:dialyxir, "~> 1.0.0-rc.0", only: [:dev], runtime: false}

We also made a minor API change from the preview, dialyzer.explain is a new top-level task that replaces --explain and --list.

asummers

asummers

Thank you everyone for your bug reports and patience as I fixed them :smile: Please make issues with any unclear language or issues you might still be having! I think the output is substantially more readable, and encourage you to play around with it. The --format short option is particularly nice for CI pipelines.

Where Next?

Popular in Announcing Top

danschultzer
In short Plug n’ play OAuth 2.0 provider library. Just set up a resource owner schema with Ecto (your user schema), install the dependen...
New
mischov
import Meeseeks.CSS html = HTTPoison.get!("https://news.ycombinator.com/").body for story <- Meeseeks.all(html, css("tr.athing")) do...
New
Azolo
Hey everyone, I just released WebSockex which is a Elixir WebSocket client. WebSockex strives to work as a OTP special process, be RFC6...
New
treble37
Just looking for a little feedback on a tiny helper library I built - Sometimes I find the need to convert maps with atom keys to maps w...
New
Jskalc
Hi! Today, after a couple weeks of development I’ve released v0.1 of LiveVue. It’s a seamless integration of Vue and Phoenix LiveView, i...
New
Hal9000
Here is my first stab at this. README pasted below. https://github.com/Hal9000/elixir_random Comments and critiques are welcome. Thank...
New
michalmuskala
Hello everybody. I have just released Jason - a new JSON library. You might be wondering, why do we need a new library? The primary foc...
New
archan937
It is a well-know topic within the Elixir community: “To mock or not to mock? :)” Every alchemist probably has his / her own opinion con...
New
wfgilman
I’ve cleaned up and open sourced three financial libraries I was using for my company. They are bindings for the APIs of these three comp...
New
trisolaran
Hi! :waving_hand: I would like to present LiveSelect, a little library that I wrote to easily add a dynamic selection input to your LV f...
198 10954 107
New

Other popular topics Top

AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 54120 245
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement