From 72fba97f10c730ed9a8027d1dc463daa33d5ca5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tristan=20Dani=C3=ABl=20Maat?= Date: Tue, 21 Jul 2026 18:01:54 +0800 Subject: [PATCH] fix(pre-commit): Fix `treefmt` being run concurrently on large repos We've configured `prek` to pass filenames to `treefmt` so that `treefmt` can be limited only to changed files. When using `prek -a` in a large repository, however, there will be too many files for the OS' command limit, so `prek` instead batches the files across multiple invocations. `treefmt` doesn't seem to like running concurrently due to its cache, however, resulting in errors. --- .pre-commit-config.yaml | 1 + nix/general/pre-commit-hooks.nix | 1 + 2 files changed, 2 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c3f064a..c89ed61 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -42,4 +42,5 @@ repos: id: treefmt language: system name: treefmt + require_serial: true repo: local diff --git a/nix/general/pre-commit-hooks.nix b/nix/general/pre-commit-hooks.nix index 221e64d..c6e6f92 100644 --- a/nix/general/pre-commit-hooks.nix +++ b/nix/general/pre-commit-hooks.nix @@ -128,6 +128,7 @@ importingFlake: { id = "treefmt"; name = "treefmt"; description = "Format *all* files"; + require_serial = true; entry = "treefmt"; language = "system";