lefthook
lefthook copied to clipboard
Lefthook doesn't seem to search the path
I am trying to use ansible-lint for linting which is installed in .venv/bin
. .venv/bin
is part of the path.
$ which lefthook
/home/jtole/go/bin/lefthook
$ lefthook run pre-commit
Lefthook v0.7.7
RUNNING HOOKS GROUP: pre-commit
EXECUTE > ansible-lint
sh: 1: ansible_lint: not found
SUMMARY: (done in 0.01 seconds)
🥊 ansible-lint
$ ansible-lint --version
ansible-lint 5.3.0 using ansible 2.12.0
$ which ansible-lint
[[ PROJECT_PATH ]]/.venv/bin/ansible-lint
EXECUTE > ansible-lint sh: 1: ansible_lint: not found
Looks like you have a typo: underscore instead of dash: which ansible-lint
but ansible_lint: not found
.
But it can be related to using GUI tools, that have problems with $PATH
. See https://github.com/evilmartians/lefthook/issues/178 for example (especially https://github.com/evilmartians/lefthook/issues/178#issuecomment-833305335)
This issue be solved via rc
option. Probably a tweak to PATH should be applied.