From 52941d152a8de1b132914252b20279dbdeb8e549 Mon Sep 17 00:00:00 2001 From: samcharles93 Date: Sat, 5 Sep 2026 08:27:35 +0000 Subject: [PATCH] skillcurator: nilerr finding at skillcurator.go:110 (archie) Implements #748 --- .../infrastructure/skillcurator/skillcurator.go | 16 +++++++++++----- .../skillcurator/skillcurator_test.go | 3 +++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/internal/infrastructure/skillcurator/skillcurator.go b/internal/infrastructure/skillcurator/skillcurator.go index c36c11e4f..9bca1b81c 100644 --- a/internal/infrastructure/skillcurator/skillcurator.go +++ b/internal/infrastructure/skillcurator/skillcurator.go @@ -112,11 +112,7 @@ func (c *Curator) reviewOne(ctx context.Context, name string) ([]curator.Action, // batch on a non-nil error, which would stop reviewing every // other skill over one bad file (see skillcurator_test.go's // "must not abort review of the others"). - return []curator.Action{{ //nolint:nilerr - Type: ActionInvalid, - Detail: name, - Reason: fail.Error(), - }}, nil + return invalidFinding(name, fail) } if missing := missingField(fm); missing != "" { @@ -141,6 +137,16 @@ func (c *Curator) reviewOne(ctx context.Context, name string) ([]curator.Action, }}, nil } +// invalidFinding converts a parse error into a per-skill action. Parse +// failures are expected findings, so they must not abort the rest of Pass. +func invalidFinding(name string, parseErr error) ([]curator.Action, error) { + return []curator.Action{{ + Type: ActionInvalid, + Detail: name, + Reason: parseErr.Error(), + }}, nil +} + // missingField returns the name of the first required frontmatter field // fm lacks, or "" if both are present. Order (name before description) // only affects which single reason is reported when both are missing; diff --git a/internal/infrastructure/skillcurator/skillcurator_test.go b/internal/infrastructure/skillcurator/skillcurator_test.go index ecec099ff..d849810de 100644 --- a/internal/infrastructure/skillcurator/skillcurator_test.go +++ b/internal/infrastructure/skillcurator/skillcurator_test.go @@ -60,6 +60,9 @@ func TestPassFlagsAParseFailureWithoutWriting(t *testing.T) { if res.Actions[0].Detail != "broken" { t.Errorf("Detail = %q, want the skill name", res.Actions[0].Detail) } + if res.Actions[0].Reason == "" { + t.Error("Reason is empty, want the parse failure") + } // The broken skill must be untouched: this curator never rewrites // content it could not parse.