Skip to content
Discussion options

You must be logged in to vote

Hey! Lefthook has a few features for monorepo, but it still has the main configuration file in the repo root.

However you can split the configuration across subfolders, for example:

# lefthook.yml

extends:
  - project1/lefthook.yml
  - project2/lefthook.yml
# project1/lefthook.yml

pre-commit:
  jobs:
    name: 'Project 1'
    root: project1/
    group:
      jobs:
        - run: ... whatever command to run within project1/ group
        - run: ...
# project2/lefthook.yml

pre-commit:
  jobs:
    name: 'Project 2'
    root: project2/
    group:
      jobs:
        - run: ... whatever command to run within project1/ group
        - run: ...

See jobs, group, root options documentation.

Lef…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@adam-ryczkowski-surfshark
Comment options

@mrexox
Comment options

Answer selected by adam-ryczkowski-surfshark
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants