- repo: ./pre-commit-hooks
sha: ''
hooks:
- id: vault
Updating pre-commit-hooks...An unexpected error has occurred: CalledProcessError: Command: ('/usr/local/bin/git', 'clone', '--no-checkout', 'pre-commit-hooks', '/Users/gretel/.pre-commit/repoiXzY0j')
Return code: 128
Expected return code: 0
Output: (none)
Errors:
fatal: repository 'pre-commit-hooks' does not exist
You'll need to use full paths: http://pre-commit.com/#developing-hooks-interactively
this is why i was requesting to support ./ style paths. it's kinda counterfeiting the concept of using git when pre-commit requires to have static paths in it's configuration, i'd say.
I think what you actually want to use is the (still undocumented unfortunately) local hooks:
https://github.com/pre-commit/pre-commit/pull/226
This lets you use the current repository to configure hooks.
The reason we can't really support relative paths is they need to refer to a universally accessible location (since hooks are cached). If we allowed relative paths, depending on cwd this could refer to a different location (and different hooks!). Local hooks aren't cached since they don't create an environment
working fine now with repo-local script. may i suggest this example to have it less-undocumented:
- repo: local
hooks:
- id: vault
name: Ansible Vault Check
language: script
description: Pre-commit hook that verifies if all files containing 'vault'
in the name are encrypted.
files: .*vault.*\.(yml|yaml)$
entry: pre-commit-hooks/vault.sh
local hooks are now documented here: http://pre-commit.com/#repository-local-hooks