From fb590d41ff11eb65e77b736e0def12715b2b3356 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sun, 4 Apr 2021 10:00:49 -0700 Subject: [PATCH] give xargs batch file execution additional headroom --- pre_commit/xargs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pre_commit/xargs.py b/pre_commit/xargs.py index 60a057c19..6b0fa2086 100644 --- a/pre_commit/xargs.py +++ b/pre_commit/xargs.py @@ -145,7 +145,9 @@ def xargs( # this is implementation details but the command gets translated into # full/path/to/cmd.exe /c *cmd cmd_exe = parse_shebang.find_executable('cmd.exe') - _max_length = 8192 - len(cmd_exe) - len(' /c ') + # 1024 is additionally subtracted to give headroom for further + # expansion inside the batch file + _max_length = 8192 - len(cmd_exe) - len(' /c ') - 1024 partitions = partition(cmd, varargs, target_concurrency, _max_length)