mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 16:24:40 +04:00
Limit xargs line length. Resolves #205.
This commit is contained in:
parent
52c2d9c35a
commit
3bf852f46a
2 changed files with 32 additions and 1 deletions
|
|
@ -10,7 +10,9 @@ def file_args_to_stdin(file_args):
|
|||
def run_hook(env, hook, file_args):
|
||||
quoted_args = [pipes.quote(arg) for arg in hook['args']]
|
||||
return env.run(
|
||||
' '.join(['xargs', '-0', hook['entry']] + quoted_args),
|
||||
# Use -s 4000 (slightly less than posix mandated minimum)
|
||||
# This is to prevent "xargs: ... Bad file number" on windows
|
||||
' '.join(['xargs', '-0', '-s4000', hook['entry']] + quoted_args),
|
||||
stdin=file_args_to_stdin(file_args),
|
||||
retcode=None,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue