mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Use Hook api in languages
This commit is contained in:
parent
5f9a667470
commit
b59d7197ff
18 changed files with 41 additions and 38 deletions
|
|
@ -85,15 +85,15 @@ def docker_cmd():
|
|||
)
|
||||
|
||||
|
||||
def run_hook(prefix, hook, file_args): # pragma: windows no cover
|
||||
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(prefix, pull=False)
|
||||
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(prefix))
|
||||
entry_tag = ('--entrypoint', entry_exe, docker_tag(hook.prefix))
|
||||
cmd = docker_cmd() + entry_tag + cmd_rest
|
||||
return helpers.run_xargs(hook, cmd, file_args)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue