From f48ac28b5cfadcc49231fb209f9042d2b29fdb04 Mon Sep 17 00:00:00 2001 From: David Gageot Date: Tue, 3 Feb 2026 15:47:46 +0100 Subject: [PATCH] Fix cagent eval metric Signed-off-by: David Gageot --- pkg/evaluation/scoring.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/evaluation/scoring.go b/pkg/evaluation/scoring.go index 640c5792a..2a4008c44 100644 --- a/pkg/evaluation/scoring.go +++ b/pkg/evaluation/scoring.go @@ -128,10 +128,10 @@ func printMetric(out io.Writer, label string, passed, total int) { } func printMetricFloat(out io.Writer, label string, passed, total float64) { - ratio := 0.0 - if total > 0 { - ratio = passed / total + if total == 0 { + return // Skip metrics with no data } + ratio := passed / total fmt.Fprintf(out, "%s %14s: %.0f/%.0f passed (%.1f%%)\n", statusIcon(ratio), label, passed, total, ratio*100) }