Add setting clippy_output_diagnostics
to match rustc_output_[...]
#3528
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Right now, capturing clippy's diagnostics is in a weird place.
capture_clippy_output
exists, but it has drastically different behavior fromrustc_output_diagnostics
in that it captures the rendered error output and hides it from the terminal, whereasrustc_output_diagnostics
captures the raw JSON and still prints out the rendered diagnostics.The loss of the JSON is a bit of an issue. With that, the only way to get JSON output from the command-line is to set
clippy_error_format
, which will necessarily clear the analysis cache and rebuild all the targets, meaning that you can't get both rendered output and JSON output without either rebuilds in-between or relying on custom transitions.This adds the missing equivalent to
rustc_output_diagnostics
in the form of a new option,clippy_output_diagnostics
. In an ideal world, I'd imagine this would be the only option to capture clippy output (since for most intents and purposes, it's strictly a superset ofcapture_clippy_output
), but using a separate option and output group preserves backwards compatibility while retaining the parallel naming ofrustc_output_diagnostics
vsclippy_output_diagnostics
, as well as the output groupsrustc_output
vsclippy_output
.