mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Factor out bash and activate files
This commit is contained in:
parent
00a3a9a09b
commit
a5b56bd9e3
13 changed files with 149 additions and 189 deletions
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from pre_commit.languages.helpers import file_args_to_stdin
|
||||
from pre_commit.languages import helpers
|
||||
|
||||
|
||||
ENVIRONMENT_DIR = None
|
||||
|
|
@ -9,16 +9,14 @@ ENVIRONMENT_DIR = None
|
|||
def install_environment(
|
||||
repo_cmd_runner,
|
||||
version='default',
|
||||
additional_dependencies=None,
|
||||
additional_dependencies=(),
|
||||
):
|
||||
"""Installation for script type is a noop."""
|
||||
raise AssertionError('Cannot install script repo.')
|
||||
|
||||
|
||||
def run_hook(repo_cmd_runner, hook, file_args):
|
||||
return repo_cmd_runner.run(
|
||||
['xargs', '-0', '{{prefix}}{0}'.format(hook['entry'])] + hook['args'],
|
||||
stdin=file_args_to_stdin(file_args),
|
||||
retcode=None,
|
||||
encoding=None,
|
||||
return helpers.run_hook(
|
||||
(repo_cmd_runner.prefix_dir + hook['entry'],) + tuple(hook['args']),
|
||||
file_args,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue