You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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: #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
Activity
asottile commentedon May 3, 2016
You'll need to use full paths: http://pre-commit.com/#developing-hooks-interactively
gretel commentedon May 3, 2016
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.asottile commentedon May 3, 2016
I think what you actually want to use is the (still undocumented unfortunately) local hooks:
#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
gretel commentedon May 3, 2016
working fine now with repo-local script. may i suggest this example to have it less-undocumented:
asottile commentedon May 4, 2016
local hooks are now documented here: http://pre-commit.com/#repository-local-hooks
Merge pull request pre-commit#367 from pre-commit/all-repos_autofix_s…