Skip to main content

Crate rust_rapport

Crate rust_rapport 

Source
Expand description

Formats cargo clippy --message-format json output for GitHub Actions.

Read diagnostics from a BufRead stream, filter errors and warnings, and write the result to a Write sink using one of the three Mode variants.

use std::io;
use rust_rapport::{Mode, run};

let mut stdout = io::stdout().lock();
let mut stderr = io::stderr().lock();
let report = run(Mode::Github, io::stdin().lock(), &mut stdout, &mut stderr)?;
std::process::exit(if report.is_failure() { 1 } else { 0 });

Structs§

RunReport
Summary of what run observed in the clippy stream.

Enums§

Error
Errors returned by run.
Mode
Output mode selected at the CLI.

Functions§

run
Reads clippy JSON from reader, formats according to mode, writes to writer.