Skip to content

feat: simplify pre-commit adapter to delegate to pre-commit#12

Merged
alecthomas merged 1 commit intomainfrom
aat/simplify-pre-commit-adapter
Mar 17, 2026
Merged

feat: simplify pre-commit adapter to delegate to pre-commit#12
alecthomas merged 1 commit intomainfrom
aat/simplify-pre-commit-adapter

Conversation

@alecthomas
Copy link
Copy Markdown
Collaborator

Instead of translating individual repo:local hooks into lefthook
commands, parse the config only to determine which stages have
hooks, then delegate to pre-commit run --hook-stage <stage>.

This supports all hook types (local and remote), and fixes a bug
where hooks with no stages/default_stages matched all stages
instead of defaulting to pre-commit only.

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
Co-authored-by: Claude Code noreply@anthropic.com
Ai-assisted: true

Instead of translating individual repo:local hooks into lefthook
commands, parse the config only to determine which stages have
hooks, then delegate to `pre-commit run --hook-stage <stage>`.

This supports all hook types (local and remote), and fixes a bug
where hooks with no stages/default_stages matched all stages
instead of defaulting to pre-commit only.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Ai-assisted: true
@alecthomas alecthomas enabled auto-merge (squash) March 17, 2026 07:14
@alecthomas alecthomas changed the title feat: Simplify pre-commit adapter to delegate to pre-commit feat: simplify pre-commit adapter to delegate to pre-commit Mar 17, 2026
@alecthomas alecthomas merged commit aa4ca6c into main Mar 17, 2026
6 checks passed
@alecthomas alecthomas deleted the aat/simplify-pre-commit-adapter branch March 17, 2026 07: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