From 1de74ce840ab45e0d6f6aa2d75f70be8076fe476 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Wed, 25 Feb 2026 13:43:13 +0000 Subject: hide read-only mode skips from human and JSON probe output --- grasp-audit/src/probe.rs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'grasp-audit/src') diff --git a/grasp-audit/src/probe.rs b/grasp-audit/src/probe.rs index d6c1482..8976400 100644 --- a/grasp-audit/src/probe.rs +++ b/grasp-audit/src/probe.rs @@ -55,6 +55,12 @@ impl ProbeReport { for check in &self.checks { if check.skipped { + // Don't list checks skipped due to read-only mode — they are + // not applicable, not failures. Only show skips caused by + // earlier check failures so the user can see the causal chain. + if check.error.as_deref() == Some("read-only mode") { + continue; + } let reason = check.error.as_deref().unwrap_or("skipped"); println!( "{}→{} {:<28} skipped {}({}){} ", @@ -103,7 +109,18 @@ impl ProbeReport { /// Print machine-readable JSON pub fn print_json(&self) { - println!("{}", serde_json::to_string_pretty(self).unwrap()); + // Exclude checks skipped due to read-only mode — they are not + // applicable and would clutter automated consumers. + let filtered = ProbeReport { + checks: self + .checks + .iter() + .filter(|c| !(c.skipped && c.error.as_deref() == Some("read-only mode"))) + .cloned() + .collect(), + ..self.clone() + }; + println!("{}", serde_json::to_string_pretty(&filtered).unwrap()); } } -- cgit v1.2.3