mirror of
https://github.com/j178/prek.git
synced 2026-04-25 02:11:36 +02:00
91a1faedcc
## Summary - Add `PREK_MAX_CONCURRENCY` environment variable to cap the maximum number of concurrent hooks - Value is floored at 1; values above CPU count are allowed (useful for I/O-bound hooks) - Invalid values show a user-visible warning and fall back to CPU count - `PREK_NO_CONCURRENCY` takes precedence when both are set ## Motivation When `ulimit -n` is low, concurrent hook execution can exhaust file descriptors. This provides an environment variable to limit concurrency. For #1696 ## Test plan - [x] `mise run lint` — no warnings - [x] `mise run test` — all tests pass - [x] Unit tests for `resolve_concurrency`: valid value, above CPU count, zero floors to 1, invalid string, empty string, unset, no_concurrency, no_concurrency overrides max Co-authored-by: Claude <noreply@anthropic.com>