Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colorized dialyzer output #823

Merged
merged 19 commits into from
Sep 22, 2015
Merged

Colorized dialyzer output #823

merged 19 commits into from
Sep 22, 2015

Conversation

Licenser
Copy link
Contributor

Some nicer dialyzer messages, making larger ones readable.

what was

https://monosnap.com/file/nARGsi1CvHoliGTukbRgdUFEvAe7cK

is now

https://monosnap.com/file/HgKtFqC90RqoKU5Du4wN5GYPnUd50w

@ferd
Copy link
Collaborator

ferd commented Sep 21, 2015

Heads up that a lot of colors can already be handled by erlware_commons (we use them in rebar3) and the deps there can be reused.

@andrzejsliwa
Copy link

great work @Licenser

@Licenser
Copy link
Contributor Author

Reached a pretty good place, all messages are colored, some I haven't seen in the wild are naively colored and perhaps can be improved later on. General color rules are:

Readable text: Bold
Bad argument/element: red
Good/expected: green
position number: blue

If something fails to output (i.e. there is an error it will fall back to the old output form).

@ferd I Looked at the commons stuff but the code does not provide the kind of capabilities I need here, or the functions in question are not exported.

@Licenser Licenser changed the title [WIP] Colorize the first dialyzer message Colorize the first dialyzer message Sep 21, 2015
@Licenser Licenser changed the title Colorize the first dialyzer message Colorized dialyzer output Sep 21, 2015
@Licenser
Copy link
Contributor Author

Note: the failed test is a issue with fetching dependencies on travis.

@tsloughter
Copy link
Collaborator

+1

@ferd merge if you are good with it. We have a lot built up as well and should cut beta-3. But with a proper version tag this time.

@ferd
Copy link
Collaborator

ferd commented Sep 22, 2015

The color scheme outputting white really messes up with light color schemes:

The bold color should be reset to the shell default, and not just assume white is the right thing to do I guess. Can't merge for now as this makes output unreadable.

@Licenser
Copy link
Contributor Author

@ferd thanks for the light terminal catch :) I'd have missed that, fixed it now it's "bold" not "bold white" and works on both light and dark backgrounds:

1 bash 2015-09-22 17-13-40

1 bash 2015-09-22 17-15-03

@ferd
Copy link
Collaborator

ferd commented Sep 22, 2015

Merging when tests pass.

@ferd
Copy link
Collaborator

ferd commented Sep 22, 2015

On second look, your screenshot seems to show a bug: ~{~<Default>,'default'>,...

@ferd
Copy link
Collaborator

ferd commented Sep 22, 2015

It appears that the line [~{~<Default,'default'>, ~<Desc,'desc'>, ~<Scope,'scope'>}~ | _] is how Dialyzer represents map syntax. Given Dialyzer will sooner or later properly support it, we'll keep it as is right now -- it's also compatible with current stuff and old stuff at once. Merging.

ferd added a commit that referenced this pull request Sep 22, 2015
@ferd ferd merged commit fa33d65 into erlang:master Sep 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants