Make `parallel: true` work with priorities
scop opened this issue · 3 comments
⚡ Summary
Would good to have parallel: true
work with priorities.
Value
Faster runs containing priorities (~ dependencies).
Behavior and configuration changes
For example:
foo:
parallel: true
commands:
cmd-a:
priority: 1
cmd-b:
priority: 2
cmd-c:
priority: 3
cmd-d:
# no priority set
cmd-e:
priority: 1
cmd-f:
priority: 3
...and lefthook run foo
would result in the commands to be run in parallel within groups determined by priority.
So the order of execution would go in sequence
- priority 1: cmd-a and cmd-e in parallel
- priority 2 (after prio 1 jobs complete): cmd-b alone
- priority 3 (after prio 2 jobs complete): cmd-c and cmd-f in parallel
- priority +Infinity (after prio 3 jobs complete): cmd-d alone
That looks otherwise nice and useful, but I suppose with the jobs config above, it would no longer be possible to run specific commands only?
With commands
one could do lefthook run pre-commit --commands COMMANDNAME
but there's no corresponding option to run only some job or group names?
Anyway for purposes of the actual topic in this issue, jobs and groups seem to fill the need fine, thanks!
Hmm, nice note. I think it should be possible to add the same --jobs
argument. But if you have jobs with the same name – all of them will be run. Do you find this useful? I think I can add it in future releases.