You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In monorepos, sometimes the CI/CD jobs running Lefthook must be specific to particular products, each included in that repo. Currently, Lefthook has no convenient way to globally include or exclude files based on criteria other than what's staged.
Value
Also, when CI/CD jobs run on the default branch, for example, Lefthook may be invoked with --all-files. Jobs specific to a product and running on non-default branches should only include files related to that product, based on which files were staged/committed.
Behavior and configuration changes
Support --exclude CLI parameter(s) that filter all file lists that Lefthook uses, even with --all-files, {files} or {staged_files}.
Design and alternatives
One feature, perhaps larger epic, is to support parsing CODEOWNERS. It's possible to create sections in there that cover one or more globs. These sections could constitute products in a monorepo. Moreover, this adds a lot of value to give specific feedback to individual developers based on their role or product responsibility, when using Lefthook as local Git hook.
Alternatively, irrelevant files/directories could be deleted or be made inaccessible from the filesystem in the CI job, before launching Lefthook. However, that leads to unstaged changes that may influence some common commands (e.g., a command to forbid unstaged changes pre-push). Sometimes files are shared between products, so they can't be removed surgically. Also, some tools, like Prettier report failure when provided with globs to paths it can't read.
Also alternatively, the Lefthook configuration file(s) could be mutated in the CI job prior to Lefthook execution, so that files are excluded somehow. That is hard to maintain and sometimes hard to implement, when using a mixture of {files}, {staged_files} and different commands etc.
The text was updated successfully, but these errors were encountered:
⚡ Summary
In monorepos, sometimes the CI/CD jobs running Lefthook must be specific to particular products, each included in that repo. Currently, Lefthook has no convenient way to globally include or exclude files based on criteria other than what's staged.
Value
Also, when CI/CD jobs run on the default branch, for example, Lefthook may be invoked with
--all-files
. Jobs specific to a product and running on non-default branches should only include files related to that product, based on which files were staged/committed.Behavior and configuration changes
Support
--exclude
CLI parameter(s) that filter all file lists that Lefthook uses, even with--all-files
,{files}
or{staged_files}
.Design and alternatives
One feature, perhaps larger epic, is to support parsing
CODEOWNERS
. It's possible to create sections in there that cover one or more globs. These sections could constitute products in a monorepo. Moreover, this adds a lot of value to give specific feedback to individual developers based on their role or product responsibility, when using Lefthook as local Git hook.Alternatively, irrelevant files/directories could be deleted or be made inaccessible from the filesystem in the CI job, before launching Lefthook. However, that leads to unstaged changes that may influence some common commands (e.g., a command to forbid unstaged changes pre-push). Sometimes files are shared between products, so they can't be removed surgically. Also, some tools, like Prettier report failure when provided with globs to paths it can't read.
Also alternatively, the Lefthook configuration file(s) could be mutated in the CI job prior to Lefthook execution, so that files are excluded somehow. That is hard to maintain and sometimes hard to implement, when using a mixture of
{files}
,{staged_files}
and different commands etc.The text was updated successfully, but these errors were encountered: