Repository navigation
Replies: 2 comments
|
@pygarap thanks for writing this up. Inheriting hook definitions also has flaws of its own:
For most hooks, the inherited part is small anyway (name, entry and file filter). I summarized the underlying problem and a possible design in #1675: #1675 (comment) |
0 replies
|
This is werid to me, if you want to inherit from a remote repo, you should just use a remote hook. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Proposal
Add a hook-level
extendsmapping, supported only underrepo: local, so local hooks can reuse remote hook definitions without copying and maintaining their metadata.repoandidfrom the remote repository's root.pre-commit-hooks.yaml, inheriting all its hook-level keys and values.name,entry, andlanguagemay be inherited rather than repeated.Usage
Proposed
.pre-commit-config.yaml, assumingruffis available onPATH:$ prek run ruff-format --all-filesThis would inherit the upstream hook's settings while overriding
languagewithsystem, running the available Ruff executable as a regular local hook.All reactions