示例#1
0
def run_hook(repo_cmd_runner, hook, file_args):  # pragma: windows no cover
    assert_docker_available()
    # Rebuild the docker image in case it has gone missing, as many people do
    # automated cleanup of docker images.
    build_docker_image(repo_cmd_runner, pull=False)

    hook_cmd = helpers.to_cmd(hook)
    entry_executable, cmd_rest = hook_cmd[0], hook_cmd[1:]

    cmd = (
        'docker',
        'run',
        '--rm',
        '-u',
        '{}:{}'.format(os.getuid(), os.getgid()),
        '-v',
        '{}:/src:rw'.format(os.getcwd()),
        '--workdir',
        '/src',
        '--entrypoint',
        entry_executable,
        docker_tag(repo_cmd_runner),
    ) + cmd_rest

    return xargs(cmd, file_args)
示例#2
0
def run_hook(hook, file_args):  # pragma: windows no cover
    assert_docker_available()
    # Rebuild the docker image in case it has gone missing, as many people do
    # automated cleanup of docker images.
    build_docker_image(hook.prefix, pull=False)

    hook_cmd = helpers.to_cmd(hook)
    entry_exe, cmd_rest = hook_cmd[0], hook_cmd[1:]

    entry_tag = ('--entrypoint', entry_exe, docker_tag(hook.prefix))
    cmd = docker_cmd() + entry_tag + cmd_rest
    return helpers.run_xargs(hook, cmd, file_args)
示例#3
0
def run_hook(hook, file_args):  # pragma: windows no cover
    assert_docker_available()
    # Rebuild the docker image in case it has gone missing, as many people do
    # automated cleanup of docker images.
    build_docker_image(hook.prefix, pull=False)

    hook_cmd = helpers.to_cmd(hook)
    entry_exe, cmd_rest = hook_cmd[0], hook_cmd[1:]

    entry_tag = ('--entrypoint', entry_exe, docker_tag(hook.prefix))
    cmd = docker_cmd() + entry_tag + cmd_rest
    return helpers.run_xargs(hook, cmd, file_args)
示例#4
0
def run_hook(repo_cmd_runner, hook, file_args):  # pragma: windows no cover
    assert_docker_available()
    # Rebuild the docker image in case it has gone missing, as many people do
    # automated cleanup of docker images.
    build_docker_image(repo_cmd_runner, pull=False)

    hook_cmd = helpers.to_cmd(hook)
    entry_executable, cmd_rest = hook_cmd[0], hook_cmd[1:]

    cmd = (
        'docker', 'run',
        '--rm',
        '-u', '{}:{}'.format(os.getuid(), os.getgid()),
        '-v', '{}:/src:rw'.format(os.getcwd()),
        '--workdir', '/src',
        '--entrypoint', entry_executable,
        docker_tag(repo_cmd_runner)
    ) + cmd_rest

    return xargs(cmd, file_args)
示例#5
0
def run_hook(repo_cmd_runner, hook, file_args):
    cmd = helpers.to_cmd(hook)
    cmd = (repo_cmd_runner.prefix_dir + cmd[0],) + cmd[1:]
    return xargs(cmd, file_args)
示例#6
0
def run_hook(repo_cmd_runner, hook, file_args):
    with in_env(repo_cmd_runner, hook['language_version']):
        return xargs(helpers.to_cmd(hook), file_args)
示例#7
0
def run_hook(repo_cmd_runner, hook, file_args):  # pragma: windows no cover
    with in_env(repo_cmd_runner):
        return xargs(helpers.to_cmd(hook), file_args)
示例#8
0
def run_hook(prefix, hook, file_args):  # pragma: windows no cover
    with in_env(prefix, hook['language_version']):
        return xargs(helpers.to_cmd(hook), file_args)
示例#9
0
def run_hook(repo_cmd_runner, hook, file_args):  # pragma: windows no cover
    assert_docker_available()
    cmd = docker_cmd() + helpers.to_cmd(hook)
    return xargs(cmd, file_args)
示例#10
0
 def run_hook(hook, file_args):
     with in_env(hook.prefix, hook.language_version):
         return helpers.run_xargs(hook, helpers.to_cmd(hook), file_args)
示例#11
0
文件: script.py 项目: xiar/pre-commit
def run_hook(repo_cmd_runner, hook, file_args):
    cmd = helpers.to_cmd(hook)
    cmd = (repo_cmd_runner.prefix_dir + cmd[0], ) + cmd[1:]
    return xargs(cmd, file_args)
示例#12
0
def run_hook(hook, file_args):  # pragma: windows no cover
    with in_env(hook.prefix):
        return helpers.run_xargs(hook, helpers.to_cmd(hook), file_args)
示例#13
0
def run_hook(hook, file_args):  # pragma: windows no cover
    assert_docker_available()
    cmd = docker_cmd() + helpers.to_cmd(hook)
    return helpers.run_xargs(hook, cmd, file_args)
示例#14
0
def run_hook(hook, file_args):  # pragma: windows no cover
    assert_docker_available()
    cmd = docker_cmd() + helpers.to_cmd(hook)
    return helpers.run_xargs(hook, cmd, file_args)
示例#15
0
def run_hook(hook, file_args):
    cmd = helpers.to_cmd(hook)
    cmd = (hook.prefix.path(cmd[0]), ) + cmd[1:]
    return helpers.run_xargs(hook, cmd, file_args)
示例#16
0
def run_hook(hook, file_args):
    with in_env(hook.prefix):
        return helpers.run_xargs(hook, helpers.to_cmd(hook), file_args)
示例#17
0
def run_hook(hook, file_args):
    return helpers.run_xargs(hook, helpers.to_cmd(hook), file_args)
示例#18
0
def run_hook(hook, file_args):
    cmd = helpers.to_cmd(hook)
    cmd = (hook.prefix.path(cmd[0]),) + cmd[1:]
    return helpers.run_xargs(hook, cmd, file_args)
示例#19
0
def run_hook(repo_cmd_runner, hook, file_args):  # pragma: windows no cover
    with in_env(repo_cmd_runner, hook['language_version']):
        return xargs(helpers.to_cmd(hook), file_args)
示例#20
0
def run_hook(repo_cmd_runner, hook, file_args):
    with in_env(repo_cmd_runner):
        return xargs(helpers.to_cmd(hook), file_args)
示例#21
0
def run_hook(prefix, hook, file_args):
    return helpers.run_xargs(hook, helpers.to_cmd(hook), file_args)
示例#22
0
def run_hook(prefix, hook, file_args):
    with in_env(prefix):
        return xargs(helpers.to_cmd(hook), file_args)
示例#23
0
def run_hook(hook, file_args):
    with in_env(hook.prefix):
        return helpers.run_xargs(hook, helpers.to_cmd(hook), file_args)
示例#24
0
def run_hook(repo_cmd_runner, hook, file_args):
    with in_env(repo_cmd_runner):
        return xargs(helpers.to_cmd(hook), file_args)
示例#25
0
def run_hook(prefix, hook, file_args):
    cmd = helpers.to_cmd(hook)
    cmd = (prefix.path(cmd[0]), ) + cmd[1:]
    return xargs(cmd, file_args)
示例#26
0
def run_hook(prefix, hook, file_args):
    with in_env(prefix, hook['language_version']):
        return helpers.run_xargs(hook, helpers.to_cmd(hook), file_args)
示例#27
0
def run_hook(repo_cmd_runner, hook, file_args):  # pragma: windows no cover
    assert_docker_available()
    cmd = docker_cmd() + helpers.to_cmd(hook)
    return xargs(cmd, file_args)