feat: add mix setup/git_hooks, activate a pre-push conventional-commit hook - #90
Merged
Conversation
…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.
There was a problem hiding this comment.
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 setupandmix git_hookstasks to configurecore.hooksPathtogithooks/idempotently. - Add a
githooks/pre-pushhook that runsci/conventional_commits.shto validate the whole push range. - Remove the duplicate
app-scopedmix githooks.installtask and update docs to referencemix 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 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 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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mix git_hookssetscore.hooksPathtogithooks/(idempotent).mix setupruns it, and is expected to grow more steps over time as more repo-management tasks land in this project.pre-pushhook alongside the existingcommit-msgone - reusesci/conventional_commits.shas-is (no changes needed: with no env vars set it already falls back tomain/origin/mainas base and the current branch as head, exactly right for a local push) to catch anything that slipped pastcommit-msg(a commit made before the hooks were installed, an amend, etc.), not just the currentHEAD.app/lib/mix/tasks/githooks.install.ex- an exact duplicate of this same idea living inapp/'s own mix project instead of the new top-level one.Readme.adoc/AGENTS.md/app/usage-rules.md's references to the old manualgit config core.hooksPath githooks/mix githooks.installsteps to point atmix setupinstead.Test plan
mix setuprun twice - installs cleanly, idempotent (identical output, no error)githooks/pre-pushrun directly - exits 0 against this branch's own commitsci/conventional_commits.shfailed CI on PR ci: catch and auto-fix AGENTS.md usage-rules drift #88's badly-worded merge commit earlier todaymix test/mix format --check-formattedclean in both projects (root andapp/)mix usage_rules.sync --checkstill passes after editingapp/usage-rules.mdgithooks.installtask🤖 Generated with Claude Code