Repository navigation
Replies: 1 comment 1 reply
|
I’d rather not introduce a new, dedicated config key/concept just for this niche use case. I think I prefer the approach proposed in #1238. |
1 reply
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.
Uh oh!
There was an error while loading. Please reload this page.
Summary
Allow
.pre-commit-hooks.yamlhooks to extendrepo: builtinhooks through aprek-onlyextendsfield, for hook authors who publish a repository consumed by end users.For each extended manifest hook,
prekshould load the referencedrepo: builtinhook as the base implementation, apply the supported hook fields declared in.pre-commit-hooks.yaml, and execute that builtin hook with the resulting configuration.The referenced hook must be a Rust-native hook available through the Explicit Builtin Repository. The manifest hook can customize its public identity, metadata, filters, arguments, and other supported hook options without requiring a wrapper executable, an external interpreter, or a separate hook environment.
Proposed syntax [
.pre-commit-hooks.yaml]For
pytest-filename-conventions,prekshould execute the builtinrequire-filename-patternimplementation while applying the manifest hook'sname,description,files, andargs.For
text-unicode-replacement-char,prekshould execute the builtindeny-patternimplementation while applying the manifest hook'sname,description,args, andtypes.Consumers could then use the published hooks as normal remote hooks:
.pre-commit-config.yamlEquivalent builtin configuration[
.pre-commit-config.yaml]The manifest hooks above should behave exactly like this direct
repo: builtinconfiguration:Required behavior
repo: builtinforextends.repo.extends.idto identify an existing hook available through the Explicit Builtin Repository..pre-commit-hooks.yamlhook to that base hook.idfor selection and output; useextends.idonly to select the builtin implementation.id,name, andextendsfor an extended manifest hook.entryorlanguage; rejectentry, and allowlanguageonly when set tosystem.repo: builtinconfiguration.prek validate-manifestandprek try-repo.extendsis specific toprek.References
repo: builtin#853All reactions