How can I test commands? #624
Answered
by
mrexox
goldingdamien
asked this question in
Q&A
-
I want to be able to test commands for the following:
It should work without any form of git staging and committing regardless of the hook tested. I thought this would be easy to do via lefthook run, but couldn't get it working. Please advise. |
Beta Was this translation helpful? Give feedback.
Answered by
mrexox
Feb 7, 2024
Replies: 1 comment 1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you @EDMPhoenix! I just want to add that
lefthook
supports a few extra options for thelefthook run <hook>
command.Let's consider the following config:
When you run
lefthook run pre-commit
thelint
command will probably be skipped because there're no staged files matching theglob
under theroot
. Instead you can do the following:Or if you want to pass all your files you can do this:
Se…