Factor out bash and activate files

This commit is contained in:
Anthony Sottile 2016-03-21 14:58:56 -07:00
parent 00a3a9a09b
commit a5b56bd9e3
13 changed files with 149 additions and 189 deletions

View file

@ -2,7 +2,7 @@ from __future__ import unicode_literals
import shlex
from pre_commit.languages.helpers import file_args_to_stdin
from pre_commit.languages import helpers
ENVIRONMENT_DIR = None
@ -11,16 +11,13 @@ ENVIRONMENT_DIR = None
def install_environment(
repo_cmd_runner,
version='default',
additional_dependencies=None,
additional_dependencies=(),
):
"""Installation for system type is a noop."""
raise AssertionError('Cannot install system repo.')
def run_hook(repo_cmd_runner, hook, file_args):
return repo_cmd_runner.run(
['xargs', '-0'] + shlex.split(hook['entry']) + hook['args'],
stdin=file_args_to_stdin(file_args),
retcode=None,
encoding=None,
return helpers.run_hook(
tuple(shlex.split(hook['entry'])) + tuple(hook['args']), file_args,
)