Skip to content

docs(agents): explain the Trunk formatter pre-commit hook - #158

Merged
ss-o merged 1 commit into
mainfrom
docs/agent-trunk-fmt-hook
Oct 19, 2026
Merged

ss-o merged 1 commit into
mainfrom
docs/agent-trunk-fmt-hook

Conversation

@ss-o

@ss-o ss-o commented Oct 19, 2026

Copy link
Copy Markdown
Member

Summary

Refs #129 (closed). Records in AGENTS.md the two Trunk behaviors behind that issue, which were only kept in agent memory:

  • .trunk/trunk.yaml enables trunk-fmt-pre-commit, which reformats staged C files, so a commit that restores src/ from main to drop a formatting pass comes out empty; drop C changes by rebuilding the branch, and check git show --stat HEAD before describing a commit.
  • The required Trunk check compares findings by line, so reformatting lines with existing clang-tidy findings reports them as new; formatting lands together with those fixes.

No issue owns this documentation change beyond #129; a maintainer decides whether it needs meta:no-issue.

Verification

Agent handoff

No handoff needed.

A commit that restores src/ to undo a clang-format pass comes out empty because trunk-fmt-pre-commit reformats staged C files, and reformatting lines with existing clang-tidy findings makes the required Trunk check report them as new (#129).

@ss-o ss-o left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fallback review under ADR-0026: Copilot request not registered on ebe4476

Findings

No actionable findings.

Scope: the full diff of 5d5c798...ebe4476 (AGENTS.md, 6 added lines), refs #129.

Note

The maintainer elected this fallback after the Copilot request did not register (no review_requested event). It is a self-review by the authoring agent, not an independent review or approval to merge.

Validation

  • Passed: all 23 completed PR checks on ebe4476 (one skipped by its workflow), including Native, Docker and Smoke Tests and Trunk Code Quality. Locally: Trunk markdownlint and prettier clean; the pre-commit hook passed.
  • Claims checked at source: .trunk/trunk.yaml:167 enables trunk-fmt-pre-commit; the main ruleset requires Trunk Code Quality / Trunk Code Quality.
  • Not re-run: the 2026-09-27 empty-commit incident (PR #131) is cited from the earlier session record.
Checklist verdicts and supporting evidence
  • Documentation accuracy: pass. The hook and the required check are confirmed above; the #129 link resolves.
  • Placement: pass. Added under "Build and test", wrapped like the surrounding paragraphs.
  • Branch name: open question. AGENTS.md lists only feature-<id> forms while the organization runbook allows docs/<slug>; Validate Branch Name passed. Recorded for the maintainer as a policy conflict, not a defect in this diff.

@ss-o
ss-o merged commit 6020843 into main Oct 19, 2026
24 checks passed
@ss-o
ss-o deleted the docs/agent-trunk-fmt-hook branch October 19, 2026 01:05
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