Skip to content

fix(lint): add return after t.Fatal to satisfy staticcheck SA5011 - #185

Merged
JAORMX merged 1 commit into
mainfrom
fix/staticcheck-sa5011-ci
Jun 25, 2026
Merged

JAORMX merged 1 commit into
mainfrom
fix/staticcheck-sa5011-ci

Conversation

@JAORMX

@JAORMX JAORMX commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

What

Fixes the CI lint failure (staticcheck SA5011: possible nil pointer dereference) that has been breaking every push to main since before the guardrails rework.

Why

Three test files had a nil-check + t.Fatal followed by a pointer dereference. staticcheck can't prove t.Fatal exits the test, so it flags the dereference as a possible nil pointer. Adding an explicit return after each t.Fatal satisfies the analyzer.

Files

  • cmd/mecatui/ui/hook_test.go:175
  • cmd/mecatui/ui/agents_overlay_test.go:528
  • cmd/mecatui/ui/models_test.go:723

Pre-existing issues, not introduced by the guardrails rework.

CI's golangci-lint (with staticcheck) flags SA5011 (possible nil pointer
dereference) in three test files where a nil check + t.Fatal is followed by
a dereference. staticcheck can't prove t.Fatal exits, so adding an explicit
return after each t.Fatal satisfies the analyzer.

These were pre-existing (not introduced by the guardrails rework) and have
been failing CI on every push to main since before #168.
@JAORMX
JAORMX merged commit 6a18981 into main Jun 25, 2026
12 of 13 checks passed
@JAORMX
JAORMX deleted the fix/staticcheck-sa5011-ci branch June 25, 2026 04:41
JAORMX added a commit that referenced this pull request Jun 25, 2026
Same class of staticcheck SA5011 failure as #185: a t.Fatalf nil-check
without a trailing return makes staticcheck flag the next line as a
possible nil pointer dereference. Adds the missing return after each
t.Fatal in the three engine-module test files CI flagged.

- engine/adapter/eventsource/review_test.go (result nil-check)
- engine/adapter/sessnap/sessnap_test.go (restoredCall nil-check)
- engine/agent/childregistry_internal_test.go (registry entry nil-check)
JAORMX added a commit that referenced this pull request Jun 25, 2026
Same class of staticcheck SA5011 failure as #185: a t.Fatalf nil-check
without a trailing return makes staticcheck flag the next line as a
possible nil pointer dereference. Adds the missing return after each
t.Fatal in the three engine-module test files CI flagged.

- engine/adapter/eventsource/review_test.go (result nil-check)
- engine/adapter/sessnap/sessnap_test.go (restoredCall nil-check)
- engine/agent/childregistry_internal_test.go (registry entry nil-check)
JAORMX added a commit that referenced this pull request Jun 25, 2026
…re transmit + spec-level verifier (#165)

* fixup! fix(mecatui): kitty mascot never rendered on Ghostty — downscale before transmit + spec-level verifier

* fix(lint): add return after t.Fatal in engine test files (SA5011)

Same class of staticcheck SA5011 failure as #185: a t.Fatalf nil-check
without a trailing return makes staticcheck flag the next line as a
possible nil pointer dereference. Adds the missing return after each
t.Fatal in the three engine-module test files CI flagged.

- engine/adapter/eventsource/review_test.go (result nil-check)
- engine/adapter/sessnap/sessnap_test.go (restoredCall nil-check)
- engine/agent/childregistry_internal_test.go (registry entry nil-check)

* docs(usage): add See-also cross-links to fix matlatl dead-end gate

The #174 docs split created 11 docs/usage/*.md leaf files that had inbound
links from the usage.md landing page's TOC but no outbound links onward —
each was a 'dead-end' under matlatl's graduated-structure check. mecatl's
.matlatl.yml promotes dead-ends from Info to Warning, and the CI docs gate
runs --strict, so warnings fail the build.

Adds a short 'See also' cross-link block to the tail of each dead-end file,
linking to a natural sibling and back to the operator-guide index. This is
the minimal fix: one outbound link clears the finding per file.

Regenerates llms.txt (task docs:llms) for the changed markdown.

---------

Co-authored-by: Jakub Hrozek <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant