Expand description
Reusable Producer implementations for common cargo subcommands.
Each producer spawns a cargo subprocess, captures its output, and
converts the result into a Report. Subprocess failures (missing
cargo, non-zero exit, parse errors) become a CheckResult::fail
inside the produced report rather than panicking.
§Available producers
| Function | Subcommand | Mapping |
|---|---|---|
cargo_test_producer | cargo test | Each test → one CheckResult (pass / fail+Error / skip for ignored). |
clippy_producer | cargo clippy | Each diagnostic → one CheckResult (warning → warn, error → fail). |
cargo_check_producer | cargo check | Each diagnostic → one CheckResult (same mapping as clippy). |
Both clippy and cargo check parse --message-format=json. The
producers do NOT escalate warnings to errors (no -D warnings); the
distinction is preserved in the produced CheckResult verdicts.
§Environment
CARGO_TARGET_DIR, CARGO, and the rest of the parent environment
are inherited by the subprocess. Callers that need a clean environment
should configure one before constructing the producer.
Structs§
- Cargo
Check Producer - Producer that runs
cargo check --message-format=jsonand maps each compiler diagnostic to oneCheckResult. - Cargo
Test Producer - Producer that runs
cargo test --no-fail-fastand maps libtest’s human-readable output to oneCheckResultper test. - Clippy
Producer - Producer that runs
cargo clippy --message-format=jsonand maps each compiler diagnostic to oneCheckResult.
Functions§
- cargo_
check_ producer - Build a producer that runs
cargo check --message-format=json. - cargo_
test_ producer - Build a producer that runs
cargo test --no-fail-fastand emits oneCheckResultper test. - clippy_
producer - Build a producer that runs
cargo clippy --message-format=json.