Skip to content

feat: add mix setup/git_hooks, activate a pre-push conventional-commit hook - #90

Merged
bougyman merged 1 commit into
mainfrom
feat-git-hooks
Aug 12, 2026
Merged

feat: add mix setup/git_hooks, activate a pre-push conventional-commit hook#90
bougyman merged 1 commit into
mainfrom
feat-git-hooks

Conversation

@bougyman

Copy link
Copy Markdown
Member

Summary

  • mix git_hooks sets core.hooksPath to githooks/ (idempotent). mix setup runs it, and is expected to grow more steps over time as more repo-management tasks land in this project.
  • Adds a new pre-push hook alongside the existing commit-msg one - reuses ci/conventional_commits.sh as-is (no changes needed: with no env vars set it already falls back to main/origin/main as base and the current branch as head, exactly right for a local push) to catch anything that slipped past commit-msg (a commit made before the hooks were installed, an amend, etc.), not just the current HEAD.
  • Removes app/lib/mix/tasks/githooks.install.ex - an exact duplicate of this same idea living in app/'s own mix project instead of the new top-level one.
  • Updates Readme.adoc/AGENTS.md/app/usage-rules.md's references to the old manual git config core.hooksPath githooks / mix githooks.install steps to point at mix setup instead.

Test plan

  • mix setup run twice - installs cleanly, idempotent (identical output, no error)
  • githooks/pre-push run directly - exits 0 against this branch's own commits
  • The underlying validation logic is already proven to catch bad subjects for real: this exact ci/conventional_commits.sh failed CI on PR ci: catch and auto-fix AGENTS.md usage-rules drift #88's badly-worded merge commit earlier today
  • mix test/mix format --check-formatted clean in both projects (root and app/)
  • mix usage_rules.sync --check still passes after editing app/usage-rules.md
  • Confirmed no remaining references anywhere to the removed githooks.install task

🤖 Generated with Claude Code

…t hook

mix git_hooks sets core.hooksPath to githooks/ (idempotent - setting the
same git config value repeatedly is a no-op). mix setup runs it, and is
expected to grow more steps over time as more repo-management tasks land
in this project.

Adds a new pre-push hook alongside the existing commit-msg one - it
reuses ci/conventional_commits.sh as-is (no changes needed: with no env
vars set it already falls back to main/origin/main as base and the
current branch as head, exactly right for a local push) to catch
anything that slipped past commit-msg (a commit made before the hooks
were installed, an amend, etc.), not just the current HEAD.

Removes app/lib/mix/tasks/githooks.install.ex - an exact duplicate of
this same idea living in app/'s own mix project instead of the new
top-level one. Updates Readme.adoc/AGENTS.md/app/usage-rules.md's
references to the old manual `git config core.hooksPath githooks` /
`mix githooks.install` steps to point at `mix setup` instead.
Copilot AI lite review requested due to automatic review settings August 12, 2026 19:04
@bougyman
bougyman merged commit a81ffe1 into main Aug 12, 2026
3 checks passed
@bougyman
bougyman deleted the feat-git-hooks branch August 12, 2026 19:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a root-level mix setup workflow to install repo git hooks and expands Conventional Commit enforcement with a new pre-push hook, while updating documentation to point contributors at the new setup flow.

Changes:

  • Add mix setup and mix git_hooks tasks to configure core.hooksPath to githooks/ idempotently.
  • Add a githooks/pre-push hook that runs ci/conventional_commits.sh to validate the whole push range.
  • Remove the duplicate app-scoped mix githooks.install task and update docs to reference mix setup.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Readme.adoc Updates contributor instructions to use mix setup for hook activation.
lib/mix/tasks/setup.ex Introduces a single entrypoint task intended to grow with additional repo setup steps.
lib/mix/tasks/git_hooks.ex Adds an idempotent Mix task to set core.hooksPath to githooks.
githooks/pre-push Adds a pre-push Conventional Commit validation hook using the existing CI script.
app/usage-rules.md Updates usage rules documentation to reflect both commit-msg and pre-push hooks and mix setup.
app/lib/mix/tasks/githooks.install.ex Removes the duplicate/legacy hook-install Mix task from the app/ project.
AGENTS.md Updates agent guidelines to reference the new hook activation flow.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread Readme.adoc
Comment on lines 333 to +334
First, activate the repo's git hooks (enforces conventional-commit subjects
before you even push):
on every commit, and again on every commit about to be pushed):
Comment thread githooks/pre-push
Comment on lines +5 to +6
# See app/usage-rules.md for the rule. Activate with:
# git config core.hooksPath githooks
bougyman pushed a commit that referenced this pull request Aug 12, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.3.0](v1.2.0...v1.3.0)
(2026-08-12)


### Features

* add mix setup/git_hooks, activate a pre-push conventional-commit hook
([#90](#90))
([a81ffe1](a81ffe1))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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.

2 participants