Skip to main content

run_validate

Function run_validate 

Source
pub fn run_validate(
    sbom_path: PathBuf,
    standards: Vec<StandardSelector>,
    output: ReportFormat,
    output_file: Option<PathBuf>,
    fail_on_warning: bool,
    summary: bool,
    cra_sidecar_path: Option<PathBuf>,
    cra_product_class: Option<String>,
    as_of: Option<&str>,
) -> Result<i32>
Expand description

Run the validate command, returning the desired exit code.

§Exit codes

These gate codes only apply to runs that completed a validation. A usage/configuration error surfaced from this function (unsupported output format, invalid --as-of or --cra-product-class, broken explicit sidecar) propagates as an Err, which the binary’s main() maps to process exit code 1 (and clap parse errors exit 2) — the same numbers as the gate codes above. CI pipelines must therefore not interpret a nonzero exit as a compliance verdict unless the expected report was produced.

The caller is responsible for calling std::process::exit() with the returned code when it is non-zero.