Description
Lefthook supports the root option for individual jobs, but not at the group level.
It should be possible to define a working directory once for all jobs nested in a group:
pre-push:
jobs:
- name: Django
group:
root: src/
jobs:
- name: System check
run: uv run manage.py check
- name: Migration check
run: uv run manage.py makemigrations --check
The group-level root value should be inherited by every nested job, while an explicit root on a nested job should override the inherited value.
What problem it is solving?
Related jobs often operate in the same subdirectory, especially in monorepos or projects whose application code is not located at the repository root. Without group-level root support, the same value must be repeated for every nested job or each command must manually change its working directory.
Supporting root on groups would reduce configuration duplication, keep the shared execution context close to the group definition, and make nested job configurations easier to maintain. Updating the working directory would require changing it in only one place and would be less likely to leave one job configured inconsistently.
Description
Lefthook supports the
rootoption for individual jobs, but not at thegrouplevel.It should be possible to define a working directory once for all jobs nested in a group:
The group-level
rootvalue should be inherited by every nested job, while an explicitrooton a nested job should override the inherited value.What problem it is solving?
Related jobs often operate in the same subdirectory, especially in monorepos or projects whose application code is not located at the repository root. Without group-level
rootsupport, the same value must be repeated for every nested job or each command must manually change its working directory.Supporting
rooton groups would reduce configuration duplication, keep the shared execution context close to the group definition, and make nested job configurations easier to maintain. Updating the working directory would require changing it in only one place and would be less likely to leave one job configured inconsistently.