Skip to content

chore: add shared pre-commit gofmt hook#4

Merged
rockfordlhotka merged 1 commit into
mainfrom
chore/precommit-gofmt-hook
Jun 16, 2026
Merged

chore: add shared pre-commit gofmt hook#4
rockfordlhotka merged 1 commit into
mainfrom
chore/precommit-gofmt-hook

Conversation

@rockfordlhotka

Copy link
Copy Markdown
Member

Adds a shared git pre-commit hook that runs the same gofmt check as CI, so formatting failures surface locally instead of after a push (as happened on PR #3).

  • .githooks/pre-commit — checks staged .go files; blocks the commit if any aren't gofmt-clean and prints the gofmt -w … fix command. Fast (staged files only).
  • Enabled per-clone with git config core.hooksPath .githooks (documented in a new Development section of the README).
  • go vet and tests stay in CI, which already runs them across Linux/macOS/Windows.

🤖 Generated with Claude Code

Mirror the CI gofmt check locally via .githooks/pre-commit, enabled with
'git config core.hooksPath .githooks'. Blocks a commit when any staged .go file
is not gofmt-clean. Documented under a new Development section in the README.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rockfordlhotka rockfordlhotka merged commit a5d863a into main Jun 16, 2026
3 checks passed
@rockfordlhotka rockfordlhotka deleted the chore/precommit-gofmt-hook branch June 16, 2026 21:48
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