Skip to content

chore(ci): add lefthook git hooks manager - #37

Merged
iap merged 3 commits into
masterfrom
feat/add-lefthook
Aug 28, 2026
Merged

chore(ci): add lefthook git hooks manager#37
iap merged 3 commits into
masterfrom
feat/add-lefthook

Conversation

@iap

@iap iap commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds Lefthook for git hook management to the template.

  • lefthook.yml — pre-commit (npm run lint) + commit-msg (type(scope): summary)
  • .lefthook/commit-msg/commit-msg-lint.sh — validates commit message format
  • README.md — documents setup via lefthook install

Verification

  • lefthook validate passes
  • Valid messages (feat:, fix(core):, docs:, chore(ci):) accepted
  • Invalid messages ("add feature", "WIP", "fix bug") rejected
  • Merge commits skipped

Setup

mise use lefthook   # or your package manager
lefthook install

Override with git commit --no-verify when needed.

Greptile Summary

Adds Lefthook-managed pre-commit linting and commit-message validation, with installation guidance in the README. The earlier report that lint failures could be suppressed is disproved: when a present project's lint script exited 23, the configured pre-commit command also exited 23 rather than allowing the commit to proceed.

Confidence Score: 5/5

No blocking failure remains.

The configured lint command propagates failures, and the commit-message validator correctly rejects invalid subjects while accepting documented conventional and merge subjects.

T-Rex T-Rex Logs

What T-Rex did

  • Ran the pre-commit hook harness against temporary projects and observed a lint failure (exit 23) and a subsequent lint success (exit 0).
  • Validated the commit-message validator by testing a nonconforming subject which was rejected (exit 1) and by testing conventional and merge subjects which were accepted (exit 0 each).
  • Parsed the Lefthook configuration and ran YAML and Bash syntax checks to confirm the declared hooks, runner, and script syntax are valid.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (3): Last reviewed commit: "chore(ci): add lefthook git hooks manage..." | Re-trigger Greptile

@iap
iap force-pushed the feat/add-lefthook branch from 197ef36 to bf02dd5 Compare August 28, 2026 02:16
Comment thread lefthook.yml Outdated
Comment thread lefthook.yml Outdated
iap and others added 2 commits August 28, 2026 21:20
Adds lefthook.yml with pre-commit (npm run lint) and commit-msg
(type(scope): summary enforcement) hooks. Scripts live under
.lefthook/<hook-name>/ per lefthook convention. README documents
setup via 'lefthook install'. Config and hook behavior verified:
valid messages accepted, invalid rejected, validate passes.
@iap
iap force-pushed the feat/add-lefthook branch from bf02dd5 to 42bb605 Compare August 28, 2026 14:23
@iap
iap merged commit 4ed511e into master Aug 28, 2026
4 checks passed
@iap
iap deleted the feat/add-lefthook branch August 28, 2026 15:15
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