mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Allow args for pcre hook
This commit is contained in:
parent
8a43a65557
commit
f0c198f1ad
3 changed files with 24 additions and 1 deletions
|
|
@ -25,7 +25,9 @@ def run_hook(repo_cmd_runner, hook, file_args):
|
|||
'xargs', '-0', 'sh', '-c',
|
||||
# Grep usually returns 0 for matches, and nonzero for non-matches
|
||||
# so we flip it here.
|
||||
'! {0} {1} $@'.format(grep_command, shell_escape(hook['entry'])),
|
||||
'! {0} {1} {2} $@'.format(
|
||||
grep_command, ' '.join(hook['args']),
|
||||
shell_escape(hook['entry'])),
|
||||
'--',
|
||||
],
|
||||
stdin=file_args_to_stdin(file_args),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue