From 2bf8906836ce744d3dbd318b908f48fd7f26bf97 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Sun, 9 Aug 2026 23:13:04 -0400 Subject: [PATCH] fix: clear staticcheck release gates --- internal/application/add/service.go | 2 +- internal/application/apply/verify_test.go | 23 ----------------------- internal/cli/version_test.go | 8 -------- internal/deployment/plan_test.go | 8 ++++---- 4 files changed, 5 insertions(+), 36 deletions(-) diff --git a/internal/application/add/service.go b/internal/application/add/service.go index b3440f7..1c7470f 100644 --- a/internal/application/add/service.go +++ b/internal/application/add/service.go @@ -133,7 +133,7 @@ func (service *Service) complete(ctx context.Context, batch resolvedBatch, reque if err != nil { return Result{}, err } - validated, err := Preflight(preflightContext{identity: batch.identity, plan: batch.plan}, items) + validated, err := Preflight(preflightContext(batch), items) if err != nil { return Result{}, err } diff --git a/internal/application/apply/verify_test.go b/internal/application/apply/verify_test.go index 76ef654..33eb548 100644 --- a/internal/application/apply/verify_test.go +++ b/internal/application/apply/verify_test.go @@ -5,10 +5,6 @@ import ( "os" "path/filepath" "testing" - - "github.com/alyraffauf/cattery/internal/deployment" - "github.com/alyraffauf/cattery/internal/failure" - "github.com/alyraffauf/cattery/internal/state" ) func TestApplyVerification(t *testing.T) { @@ -176,22 +172,3 @@ func testVerifyStateSilent(t *testing.T) { t.Fatalf("verification must not commit state, baselines = %d transitions = %d", pair.baselines.calls, pair.transitions.calls) } } - -// verifyErrorKind asserts a verification failure category. -func verifyErrorKind(t *testing.T, err error, kind failure.Kind) { - t.Helper() - if err == nil || !kindIs(err, kind) { - t.Fatalf("error = %v, want %s", err, kind) - } -} - -// secretRowFor freezes one active secret baseline over the envelope. -func secretRowFor(target string) state.FileBaseline { - cipher := []byte(`{"data":"c2VjcmV0","sops":{"version":"3.9.0"}}`) - return state.FileBaseline{ - TargetPath: target, SourcePath: "files/token", SourceKind: deployment.FileSecret, Layer: deployment.LayerBase, - BaselineContentHash: deployment.SecretSemantic([]byte("plaintext"), [32]byte{7}), - BaselineSourceHash: deployment.RawStorage(cipher), - Status: state.StatusActive, - } -} diff --git a/internal/cli/version_test.go b/internal/cli/version_test.go index eec3a07..9e0d04d 100644 --- a/internal/cli/version_test.go +++ b/internal/cli/version_test.go @@ -120,11 +120,3 @@ func testVersionNoBackend(t *testing.T) { t.Fatalf("calls = %d, want two independent invocations", service.calls) } } - -// unsupportedRepoVersion guards against accidental flag handling. -func unsupportedRepoVersion(t *testing.T, command *cobra.Command) { - t.Helper() - if command.Flags().Lookup("repo") != nil { - t.Fatal("version must not declare repository flags") - } -} diff --git a/internal/deployment/plan_test.go b/internal/deployment/plan_test.go index ec5a39d..0e5de57 100644 --- a/internal/deployment/plan_test.go +++ b/internal/deployment/plan_test.go @@ -54,10 +54,10 @@ func testPlanCopiesInputs(t *testing.T) { aliases := candidate.Aliases hooks := candidate.Hooks plan := mustPlan(candidate) - groups = append(groups, " mutated") - files = append(files, ManagedFile{TargetRelativePath: "x"}) - aliases = append(aliases, Alias{AliasRelativePath: "x"}) - hooks = append(hooks, Hook{Name: "x"}) + groups[0] = " mutated" + files[0] = ManagedFile{TargetRelativePath: "x"} + aliases[0] = Alias{AliasRelativePath: "x"} + hooks[0] = Hook{Name: "x"} if len(plan.Groups()) != 2 { t.Fatalf("groups leaked: %v", plan.Groups()) } -- 2.51.2