-
-
Notifications
You must be signed in to change notification settings - Fork 83
Description
It would make it easier to centrally manage hooks that should apply to several git repositories at the same time.
Let's assume we have some central repo with a pre-commit hooks config that contains lots of best practices for a certain kind of project:
foobar/imaginary-central-repo/.pre-commit-hooks.yaml:
- repo: https://github.com/crate-ci/typos
rev: b04a3e939a8f2800a1dc330d7e569e7557879d41 # frozen: v1
hooks:
- id: typos
- args: []
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 740a8f85dd054f284b506c33d50b4b1f0d7d20d1 # frozen: v0.14.4
hooks:
- id: ruff
A project that wants to keep track of these best practices could specify something like this:
some-other-repo/.pre-commit-hooks.yaml:
- inherit: https://github.com/foobar/imaginary-central-repo
rev: 0eb92d25fd38ba5bad2f8d2ea7df63ad23e18ae3 # frozen: v1.0
hooks:
- extend: ruff
additional_dependencies:
- some_library
(the name of the options are just examples - subject to bikeshedding)
It would automatically inherit the typos and the ruff hook from the "best practice" repo in this example.
Just being able to do that would be really nice.
Even better would be to have some option to extend / overwrite certain settings (in particular things like the files filter or the additional_dependencies, ...)