Uh oh!
There was an error while loading. Please reload this page.
Emit ansi color codes in the rendered field of json diagnostics - #59128
Conversation
rust-highfive
commented
Mar 12, 2019
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
ehuss
commented
Mar 12, 2019
I've been looking at doing something similar to this. I'm considering using JSON output only for Cargo for a few reasons. Do you happen to know if the "rendered" field is fully consistent with the normal output? |
This comment has been minimized.
This comment has been minimized.
oli-obk
commented
Mar 12, 2019
Yes it's identical. It's actually generated by invoking the regular diagnostic renderer and just recording the output. |
eddyb
commented
Mar 12, 2019
@oli-obk Can we get |
oli-obk
commented
Mar 12, 2019
Oh yea, totally forgot about this. I've been meaning to fix that in forever. I'll do that in this PR as to not regress the status quo even further. |
mark-i-m
commented
Mar 12, 2019
My email is telling me I was r?-ed, but I can't see myself in this thread... am I missing something? |
oli-obk
commented
Mar 12, 2019
the |
mark-i-m
left a comment
There was a problem hiding this comment.
LGTM, even though I don't have r? permissions :)
oli-obk
commented
Mar 12, 2019
Note that this would not have changed the rendered output (because that would severely screw with r? @eddyb |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Does this panic! match what proc_res.fatal would do?
Nevermind, it avoids fatal trying to print the rendered field from JSON (and failing).
There was a problem hiding this comment.
I assume this is the main compiletest change? 🎉
oli-obk
commented
Mar 13, 2019
@bors r=mark-i-m,eddyb |
bors
commented
Mar 13, 2019
📌 Commit 8f1d62befd2db8bfbe0eef0cd163945fafde2bf4 has been approved by |
This comment has been minimized.
This comment has been minimized.
oli-obk
commented
Mar 13, 2019
@bors r- |
This comment has been minimized.
This comment has been minimized.
oli-obk
commented
Mar 14, 2019
@bors r=mark-i-m,eddyb |
bors
commented
Mar 14, 2019
📌 Commit b5fc2c41b39c666fce1c275690a79bdc9cdc33d0 has been approved by |
There was a problem hiding this comment.
I don't see a test for the current output here :-/
Also, although I see the immediate benefit of this, I would like for us to tackle a more "general" solution at some point where we can also produce HTML, for example.
There was a problem hiding this comment.
We do have other --error-format pretty-json ui tests.
So you're imagining something like --json-rendered=(plain|termcolor|html)?
There was a problem hiding this comment.
In my mind something like --json-rendered=extended where the textual output would be the same and we'd have extra json fields annotating those with extra information:
{"text": "path `std::string::String`", "annotations": [{"start": 6, "end": 25, "highlight_type": "highlighted"}]}
That way any tool can consume these and turn them into whatever their needs may be.
That being said, having specific support for both terminal and html output make sense to me, given they probably cover 80% of all likely use cases.
There was a problem hiding this comment.
The --json-rendered list can be extended in the future to support schemes like the one you proposed. I will change the PR to only support plain and termcolor for now.
bors
commented
Apr 9, 2019
🌲 The tree is currently closed for pull requests below priority 15, this pull request will be tested once the tree is reopened |
bors
commented
Apr 11, 2019
⌛ Testing commit 325936a with merge 1d700581f3bce5188c75e2e789d93ea6b97acfed... |
bors
commented
Apr 11, 2019
💔 Test failed - status-appveyor |
oli-obk
commented
Apr 11, 2019
I guess color codes differ between windows and linux? |
Centril
commented
Apr 14, 2019
@bors r- |
oli-obk
commented
Apr 16, 2019
@bors r=mark-i-m,eddyb |
bors
commented
Apr 16, 2019
📌 Commit 55534e41dda3847c605f56a32b6e7d5b1ea483c5 has been approved by |
rust-highfive
commented
Apr 16, 2019
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
oli-obk
commented
Apr 16, 2019
@bors r- |
oli-obk
commented
Apr 17, 2019
@bors r=mark-i-m,eddyb |
bors
commented
Apr 17, 2019
📌 Commit 5c6a43a has been approved by |
…ddyb Emit ansi color codes in the `rendered` field of json diagnostics cc @ljedrz Implemented for rust-lang#56595 (comment) (x.py clippy)
Rollup of 5 pull requests Successful merges: - #59128 (Emit ansi color codes in the `rendered` field of json diagnostics) - #59646 (const fn: Improve wording) - #59986 (Miri: refactor new allocation tagging) - #60003 (LLD is not supported on Darwin) - #60018 (Miri now supports entropy, but is still slow) Failed merges: r? @ghost
cc @ljedrz
Implemented for #56595 (comment) (x.py clippy)