lefthook icon indicating copy to clipboard operation
lefthook copied to clipboard

Lefthook doesn't seem to search the path

Open josephtole opened this issue 3 years ago • 1 comments

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

josephtole avatar Dec 13 '21 12:12 josephtole

 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)

Envek avatar Dec 27 '21 07:12 Envek

This issue be solved via rc option. Probably a tweak to PATH should be applied.

mrexox avatar Oct 04 '23 12:10 mrexox