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
exit_codes::SUCCESS(0): compliant (no errors; no warnings when--fail-on-warningis set)exit_codes::COMPLIANCE_ERRORS(1): one or more compliance errors foundexit_codes::COMPLIANCE_WARNINGS(2): warnings found with--fail-on-warning
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.