mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
adjust the run_hook api to no longer take Hook
This commit is contained in:
parent
48ae18a2cb
commit
628c876b2d
26 changed files with 163 additions and 192 deletions
|
|
@ -8,16 +8,17 @@ from typing import Sequence
|
|||
from pre_commit.envcontext import envcontext
|
||||
from pre_commit.envcontext import PatchesT
|
||||
from pre_commit.envcontext import Var
|
||||
from pre_commit.hook import Hook
|
||||
from pre_commit.languages import helpers
|
||||
from pre_commit.prefix import Prefix
|
||||
from pre_commit.util import cmd_output_b
|
||||
|
||||
BUILD_DIR = '.build'
|
||||
BUILD_CONFIG = 'release'
|
||||
|
||||
ENVIRONMENT_DIR = 'swift_env'
|
||||
get_default_version = helpers.basic_get_default_version
|
||||
health_check = helpers.basic_health_check
|
||||
BUILD_DIR = '.build'
|
||||
BUILD_CONFIG = 'release'
|
||||
run_hook = helpers.basic_run_hook
|
||||
|
||||
|
||||
def get_env_patch(venv: str) -> PatchesT: # pragma: win32 no cover
|
||||
|
|
@ -47,11 +48,3 @@ def install_environment(
|
|||
'-c', BUILD_CONFIG,
|
||||
'--build-path', os.path.join(envdir, BUILD_DIR),
|
||||
)
|
||||
|
||||
|
||||
def run_hook(
|
||||
hook: Hook,
|
||||
file_args: Sequence[str],
|
||||
color: bool,
|
||||
) -> tuple[int, bytes]: # pragma: win32 no cover
|
||||
return helpers.run_xargs(hook, hook.cmd, file_args, color=color)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue