use dev_security::{AuditError, AuditRun, AuditScope};
fn main() {
let run = AuditRun::new("example", "0.1.0").scope(AuditScope::All);
let result = match run.execute() {
Ok(r) => r,
Err(AuditError::AuditToolNotInstalled) => {
eprintln!("cargo-audit is not installed; skipping the example.");
eprintln!("Install with: cargo install cargo-audit");
return;
}
Err(AuditError::DenyToolNotInstalled) => {
eprintln!("cargo-deny is not installed; skipping the example.");
eprintln!("Install with: cargo install cargo-deny");
return;
}
Err(e) => {
eprintln!("audit failed: {e}");
return;
}
};
let report = result.into_report();
println!("{}", report.to_json().expect("serialize report"));
}