Skip to content

chore: add githooks to guard against unexpected commits#546

Open
zimeg wants to merge 3 commits into
mainfrom
zimeg-chore-githooks
Open

chore: add githooks to guard against unexpected commits#546
zimeg wants to merge 3 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.62%. Comparing base (3720e4f) to head (ccddd9f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #546      +/-   ##
==========================================
- Coverage   71.64%   71.62%   -0.02%     
==========================================
  Files         225      225              
  Lines       19074    19074              
==========================================
- Hits        13665    13662       -3     
- Misses       4202     4206       +4     
+ Partials     1207     1206       -1     

☔ 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.

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