-
-
Notifications
You must be signed in to change notification settings - Fork 99
Description
I would like a way to automate the hook bootstrapping without needing to upstream a .pre-commit-hooks.yaml. Most maintainers rightful don't want a .pre-commit-hooks.yaml in their repo just to define the entry-point for a tool they're unfamiliar with. Conversely, I don't want to hassle with installation or compatibility issues while managing locally installed tools.
Effectively the equivalent of,
repos:
- repo: local
hooks:
- id: go-build-and-run
language: system
entry: bash -c 'set -euo pipefail; go build github.com/me/my-app@v1.0.0 -o /tmp/my-app && /tmp/my-app'But using the builtin go toolchain + pin a revision to ensure compatibility across users.
Something along the lines of,
repos:
- repo: github.com/me/my-app
rev: v1.0.0
hooks:
- id: go-build-and-run
name: My app
language: golang
entry: my-appAlso, I think this would improve existing pre-commit providers. Cases like uv-pre-commit where the tool version is frozen in the repository. This allows those tools to be kept fresh with prek auto-update (rather than keeping the hook implementation fresh and maybe implicitly the tool). These provider repos (like uv-pre-commit) may even become mostly obsolete?