diff --git a/compliance-agent/src/pipeline/sbom.rs b/compliance-agent/src/pipeline/sbom.rs index e19e10f..e404b3c 100644 --- a/compliance-agent/src/pipeline/sbom.rs +++ b/compliance-agent/src/pipeline/sbom.rs @@ -77,13 +77,22 @@ async fn generate_lockfiles(repo_path: &Path) { tracing::info!("attempting to generate pip requirements for SBOM scan"); if repo_path.join("pyproject.toml").exists() { let result = tokio::process::Command::new("pip-compile") - .args(["--quiet", "--output-file", "requirements.txt", "pyproject.toml"]) + .args([ + "--quiet", + "--output-file", + "requirements.txt", + "pyproject.toml", + ]) .current_dir(repo_path) .output() .await; match result { - Ok(o) if o.status.success() => tracing::info!("requirements.txt generated via pip-compile"), - _ => tracing::warn!("pip-compile not available or failed, Syft will parse pyproject.toml directly"), + Ok(o) if o.status.success() => { + tracing::info!("requirements.txt generated via pip-compile") + } + _ => tracing::warn!( + "pip-compile not available or failed, Syft will parse pyproject.toml directly" + ), } } } @@ -154,7 +163,11 @@ async fn enrich_cargo_licenses(repo_path: &Path, entries: &mut [SbomEntry]) { let license_map: std::collections::HashMap<(&str, &str), &str> = meta .packages .iter() - .filter_map(|p| p.license.as_deref().map(|l| (p.name.as_str(), p.version.as_str(), l))) + .filter_map(|p| { + p.license + .as_deref() + .map(|l| (p.name.as_str(), p.version.as_str(), l)) + }) .map(|(n, v, l)| ((n, v), l)) .collect(); diff --git a/compliance-dashboard/src/pages/sbom.rs b/compliance-dashboard/src/pages/sbom.rs index c676214..bae5756 100644 --- a/compliance-dashboard/src/pages/sbom.rs +++ b/compliance-dashboard/src/pages/sbom.rs @@ -37,9 +37,7 @@ pub fn SbomPage() -> Element { }); // ── Dynamic filter options (package managers + licenses from DB) ── - let sbom_filters = use_resource(|| async { - fetch_sbom_filters().await.ok() - }); + let sbom_filters = use_resource(|| async { fetch_sbom_filters().await.ok() }); // ── SBOM list (filtered) ── let sbom = use_resource(move || {