lefthook

Solid

Canonical lefthook git-hooks setup — pre-commit (format, check, secret scan) and pre-push (test), each delegating to `mise run` tasks. Use when configuring or debugging git hooks.

Code & Development 4 stars 1 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 80/100

Stars 20%
23
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Lefthook Git Hooks Standard Canonical git-hooks setup using **lefthook**. Keep hooks thin by delegating every command to a `mise run` task, so local hooks and CI run the exact same checks. Lefthook decides _when_ to run; [mise](../mise/SKILL.md) owns _what_ each command does. ## Principles - **pre-commit** (fast): format staged files, then run the static checks and secret scan. - **pre-push** (slower): the test suite. - **post-commit** (optional): repair state the commit itself invalidated — for a repo that deploys a binary built from its own sources, rebuild and redeploy it here, guarded so it only fires when the commit touched a real build input. Git ignores this hook's exit status, so it reports without ever blocking a commit. - **Delegate, don't duplicate**: every command is a thin `mise run <task>`; the command name mirrors the task (`format:go` → `mise run format:go`). Tasks are owned by the language stack ([go-stack](../go-stack/SKILL.md), [python-stack](../python-stack/SKILL.md)) — see the [mise skill](../mise/SKILL.md). - **Staged formatters, whole-tree checks**: formatters take `{staged_files}` and restage their fixes (`stage_fixed: true`); `check`/`test` take no files so they always run on the whole tree — "run everything before commit/push". - **Clean output**: suppress version headers and successful commands to keep commits quiet and distraction-free. ## Setup 1. Add lefthook using mise (Go: [go-stack](../go-stack/SKILL.md); Python: [python-stack](../pytho...

Details

Author
fmind
Repository
fmind/dotfiles
Created
4 months ago
Last Updated
yesterday
Language
Go
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category