Skip to main content

Crate unsafe_budget

Crate unsafe_budget 

Source
Expand description

§unsafe-budget

an unsafe code budget gate for ci pipelines.

this library provides the core functionality for tracking unsafe code usage in rust and go projects, comparing against baselines, and enforcing budgets.

§quick example

use unsafe_budget::analyzer::detect_analyzer;
use unsafe_budget::model::ScanOpts;

let opts = ScanOpts::default();
let analyzer = detect_analyzer(&opts);
let result = analyzer.run(&opts).unwrap();

println!("total unsafe: {}", result.totals.overall_unsafe);
for unit in &result.units {
    println!("  {}: {}", unit.name, unit.unsafe_count);
}

§modules

  • analyzer - analyzer trait and built-in implementations
  • budget - budget comparison engine (ratchet and caps modes)
  • config - configuration and baseline file handling
  • model - core data types (ScanResult, Unit, etc.)
  • output - text and json formatters

Modules§

analyzer
budget
cli
config
error
model
core data types for unsafe-budget.
output
sarif
SARIF output conversion.