Skip to content

chore: add githooks to guard against unexpected commits#546

Merged
zimeg merged 4 commits into
mainfrom
zimeg-chore-githooks
May 18, 2026
Merged

chore: add githooks to guard against unexpected commits#546
zimeg merged 4 commits into
mainfrom
zimeg-chore-githooks

Conversation

@zimeg
Copy link
Copy Markdown
Member

@zimeg zimeg commented May 14, 2026

Changelog

N/A - We hope to keep main branch beautiful!

Summary

This PR guards against commits to the main branch or with incorrect formatting to unlock more agentic loops with confidence 👾 ✨

Testing

Checkout this branch and use incorrect formatting somewhere then run this command:

$ git config core.hooksPath .githooks

Open a new shell and attempt to commit!

$ git commit -m "asdf"
cmd/api/api.go:303:1: File is not properly formatted (gofmt)
        return result.APIAccessTokens.Bot, nil
^
1 issues:
* gofmt: 1

Notes

  • Unsure if make is better to call in the Git hook without having matched dependencies?

Requirements

@zimeg zimeg added this to the Next Release milestone May 14, 2026
@zimeg zimeg self-assigned this May 14, 2026
@zimeg zimeg requested a review from a team as a code owner May 14, 2026 19:12
@zimeg zimeg added code health M-T: Test improvements and anything that improves code health semver:patch Use on pull requests to describe the release version increment labels May 14, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.64%. Comparing base (3720e4f) to head (f06978f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #546   +/-   ##
=======================================
  Coverage   71.64%   71.64%           
=======================================
  Files         225      225           
  Lines       19074    19074           
=======================================
  Hits        13665    13665           
  Misses       4202     4202           
  Partials     1207     1207           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@WilliamBergamin WilliamBergamin left a comment

Choose a reason for hiding this comment

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

YESSSS

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@zimeg
Copy link
Copy Markdown
Member Author

zimeg commented May 14, 2026

@WilliamBergamin I share your excitement 😸 🎉

I'm hoping this approach is alright since I understand forked branches might prefer to contribute from "main" branch, but the workarounds of "--no-verify" or using another branch do seem reasonable to me! 🤓

Copy link
Copy Markdown
Member

@mwbrooks mwbrooks left a comment

Choose a reason for hiding this comment

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

✅ Very nice @zimeg!

📝 Could we consider adding this rule to our CLAUDE.md - I know the hook should catch Claude from doing the commit, but it may be beneficial to just have it in Claude's context immediately.

@zimeg zimeg enabled auto-merge (squash) May 18, 2026 16:27
@zimeg
Copy link
Copy Markdown
Member Author

zimeg commented May 18, 2026

@WilliamBergamin @mwbrooks Super appreciate the guards against unexpected commits from landing in remotes 👽 🌠

Let's now merge this with passing tests.

@zimeg zimeg merged commit afcb85d into main May 18, 2026
10 checks passed
@zimeg zimeg deleted the zimeg-chore-githooks branch May 18, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code health M-T: Test improvements and anything that improves code health semver:patch Use on pull requests to describe the release version increment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants