Saving a specific message-format
to a file, while also producing "normal" output
#14555
Labels
A-console-output
Area: Terminal output, colors, progress bar, etc.
A-json-output
Area: JSON message output
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
S-needs-team-input
Status: Needs input from team on whether/how to proceed.
Problem
In CI, it can be useful to generate a code-quality report while also printing a job log designed for humans to read.
cargo check
provides--message-format json
, which enables generating machine-readable output that can be used to generate a report programmatically (e.g. with https://crates.io/crates/gitlab_clippy); but currently, there's no way to do this in such a way thatcargo
also produces useful human-readable output.cargo clippy --message-format json | tee <file>
is too verbose and difficult to read.Because of this,
gitlab_clippy
recommends runningcargo check
twice in CI, once to produce readable output and fail the job if there are errors, and again to produce a report.Proposed Solution
There could be an additional flag that would take a file argument and permit sending
json
messages to that file, while emitting the "normal" Cargo output onstdout
.Notes
No response
The text was updated successfully, but these errors were encountered: