-
Notifications
You must be signed in to change notification settings - Fork 6.1k
[solc] colorized diagnostics output #5511
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
Conversation
d244857
to
65f5c5b
Compare
This comment has been minimized.
This comment has been minimized.
65f5c5b
to
8f45178
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
8f45178
to
fc468e4
Compare
Sounds good, but please split it up. |
5f48c14
to
166a089
Compare
166a089
to
f8d3bcc
Compare
6c27cbc
to
45e1d79
Compare
45e1d79
to
b0e16aa
Compare
for_each( | ||
_ref.text.cbegin(), | ||
_ref.text.cbegin() + _ref.startColumn, | ||
[this](char ch) { m_stream << (ch == '\t' ? '\t' : ' '); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! We might even have a bug about this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I too actually held back for a moment on that line, but said if that's a bug, then it was there before already, and I'd prefer to address it in a separate PR (as the base class is affected then, too).
268953e
to
5a336f4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now!
I think there is still an inconsistency with regards to spacing between the errors.
And this is how it looks without an error with secondary source location:
I would have expected the secondary source location to be appended without an empty line between the main location and the secondary location. Also we might want to add an empty line between two errors (actually this is how your screenshot in the description has it). |
If we make more changes to this anyways, then I vote for changing the command line argument from |
Oh and another thing I just noticed: At least in the screenshot in the description, the line numbering it says |
Ah ok, but the thing I pasted at least has it right. |
Output is now as follows:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
I also verified that the old reporter is used with standard-json. |
…ttedScope a future commit/PR could replace existing code to use AnsiColorized and remove the old implementation of FormattedScope.
…pretty and colored output. * Refactors output format in a way it is (or should at least be) more readable. (NB.: As source of inspiration, I chose the rustc compiler output.) * Adds color support to the stream output. * Also improves multiline source formatting (i.e. truncating too long lines, like done with single lines already) * solc: adds flags --color (force terminal colors) and --no-color (disable autodetection) * solc: adds --new-reporter to give output in *new* formatting (colored or not) * Changelog adapted accordingly.
Rebased. |
bdb5fb5
to
3d4b0f4
Compare
P.S. @chriseth I didn't rename it to |
I guess the plan is to make it the default starting from 0.6.0 |
This PR is a resurrection of #3046 and their related #4338 and #4340.
--color
for forced colorized output and--no-color
for explicitly disabling terminal-autodetection, e.g. if none of these will be given, the diagnostic output will be colored when stdout/stderr is connected to a terminal.please note
Only the last 3 commits matter, the rest is from the rebase.