Skip to content

Unexpected behaviour of option root #574

Answered by mrexox
giovannibaratta asked this question in Q&A
Discussion options

You must be logged in to vote

Hey! A very good question, and yes, root is also used for implicit filtering, because lefthook assumes that if you want the command to be run in a certain root folder, you care only about files in this directory. I will edit the docs to include this behavior description.

It looks like you just want the command to be run from another folder but keep files unfiltered. Right now this can't be easily configured but I can suggest you something like this:

pre-push:
  parallel: true
  commands:
    run-e2e-tests:
      run: lefthook run e2e-tests

e2e-tests:
  parallel: true
  commands:
      root: core
      run: yarn test:e2e

So, here is a pre-push hook that doesn't use any filters, so nothing…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@giovannibaratta
Comment options

Answer selected by giovannibaratta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants