Skip to content
Discussion options

You must be logged in to vote

Hey! Good question. I think you can use a few approaches:

  1. Use one lefthook config in the root of the monorepo
  2. Use one config in the monorepo root and other configs in subfolders. Import them to the main config

For the first approach I think you can have something like this:

# lefthook.yml

pre-commit:
  jobs:
    - name: pytest
      glob: "*.py"
      group:
        parallel: true
        jobs:
          - root: 'subfolder1'
            run: pytest
          - root: 'subfolder2'
            run: pytest
          - root: 'subfolder3'
            run: pytest

For the second approach:

# lefthook.yml

extends:
  - subfolder1/lefthook.yml
  - subfolder2/lefthook.yml
# subfolder1/lefthook.yml

Replies: 1 comment 1 reply

Comment options

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

Answer selected by mrexox
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