Best way to run multiple groups?
I'm trying to separate my precommit hook into jobs that are parallelizable vs those that are not. I've got this basic setup:
pre-commit:
parallel: false
commands:
readonly:
run: lefthook run readonly
writable:
run: lefthook run writable
readonly:
parallel: true
commands:
...
writable:
parallel: false
commands:
...
I'm wondering if there is a better way to do this than executing lefthook from inside itself. Additionally, this is combining with #78 in a bad way and generating even more useless info in my terminal (e.g. the Lefthook version is printed on 3 separate lines).
Hi @thieman !
Looks like you have a problem with concurrent overrides. Could you try flock utility?
It described here: https://github.com/Arkweid/lefthook/blob/master/docs/full_guide.md#concurrent-files-overrides
That might be doable, but it's not optimal. It's yet another dependency I need to install to make my hooks work at all, and I'm trying to support both Linux and macOS so that's a bit more painful than it might sound.
As lefthook's essentially a task runner, it seems to me like this would fit nicely in lefthook itself as a feature enhancement. Do you agree?
Yea, agree. That would be nice.