mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-13 12:30:08 -06:00
Merge pull request #474 from pre-commit/go_passes_on_windows
The golang tests pass on windows
This commit is contained in:
@@ -15,14 +15,14 @@ from pre_commit.xargs import xargs
|
||||
ENVIRONMENT_DIR = 'golangenv'
|
||||
|
||||
|
||||
def get_env_patch(venv): # pragma: windows no cover
|
||||
def get_env_patch(venv):
|
||||
return (
|
||||
('PATH', (os.path.join(venv, 'bin'), os.pathsep, Var('PATH'))),
|
||||
)
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def in_env(repo_cmd_runner): # pragma: windows no cover
|
||||
def in_env(repo_cmd_runner):
|
||||
envdir = repo_cmd_runner.path(
|
||||
helpers.environment_dir(ENVIRONMENT_DIR, 'default'),
|
||||
)
|
||||
@@ -47,7 +47,7 @@ def install_environment(
|
||||
repo_cmd_runner,
|
||||
version='default',
|
||||
additional_dependencies=(),
|
||||
): # pragma: windows no cover
|
||||
):
|
||||
helpers.assert_version_default('golang', version)
|
||||
helpers.assert_no_additional_deps('golang', additional_dependencies)
|
||||
directory = repo_cmd_runner.path(
|
||||
@@ -67,6 +67,6 @@ def install_environment(
|
||||
cmd_output('go', 'get', './...', cwd=repo_src_dir, env=env)
|
||||
|
||||
|
||||
def run_hook(repo_cmd_runner, hook, file_args): # pragma: windows no cover
|
||||
def run_hook(repo_cmd_runner, hook, file_args):
|
||||
with in_env(repo_cmd_runner):
|
||||
return xargs(helpers.to_cmd(hook), file_args)
|
||||
|
||||
Reference in New Issue
Block a user