bazelbuild / bazelbuild/rules_rust

No way to use capture_clippy_output with json error format for clippy only

Open
#2,215 0 comments 0 reactions 0 assignees View on GitHub
needs-triage
Dominant language
Starlark
Stars
843
Forks
651
Avg merge
2d 18h
Merged PRs (30d)
15

Description

I'd like to write a rule that uses capture_clippy_output to get Clippy diagnostics in JSON format. Right now, the only way to do so is using `--@rules_rust//:capture_clippy_output=True --@rules_rust//:error_format=json` (actually I'm using the equivalent transition). However, error_format=json applies globally to all the deps, meaning that if any dependencies emit warnings, they print to the console as JSON.

I'd argue that capture_clippy_output should just imply --error-format=json but _only for the clippy-driver invocation_ - it seems unlikely that a machine consumer would want the non-json format. Or I guess we could have a separate `clippy_output_error_format` config (or change `capture_clippy_output` to a string).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.