mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Address PR feedback
This commit is contained in:
parent
950bc2c7fb
commit
1eed1b51b8
2 changed files with 3 additions and 8 deletions
|
|
@ -7,7 +7,6 @@ import sys
|
||||||
import pre_commit.constants as C
|
import pre_commit.constants as C
|
||||||
from pre_commit import git
|
from pre_commit import git
|
||||||
from pre_commit.envcontext import envcontext
|
from pre_commit.envcontext import envcontext
|
||||||
from pre_commit.envcontext import UNSET
|
|
||||||
from pre_commit.envcontext import Var
|
from pre_commit.envcontext import Var
|
||||||
from pre_commit.languages import helpers
|
from pre_commit.languages import helpers
|
||||||
from pre_commit.util import clean_path_on_failure
|
from pre_commit.util import clean_path_on_failure
|
||||||
|
|
@ -22,7 +21,6 @@ healthy = helpers.basic_healthy
|
||||||
|
|
||||||
def get_env_patch(venv):
|
def get_env_patch(venv):
|
||||||
return (
|
return (
|
||||||
('GOBIN', UNSET),
|
|
||||||
('PATH', (os.path.join(venv, 'bin'), os.pathsep, Var('PATH'))),
|
('PATH', (os.path.join(venv, 'bin'), os.pathsep, Var('PATH'))),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ def _test_hook_repo(
|
||||||
path = make_repo(tempdir_factory, repo_path)
|
path = make_repo(tempdir_factory, repo_path)
|
||||||
config = make_config_from_repo(path, **(config_kwargs or {}))
|
config = make_config_from_repo(path, **(config_kwargs or {}))
|
||||||
ret = _get_hook(config, store, hook_id).run(args)
|
ret = _get_hook(config, store, hook_id).run(args)
|
||||||
assert ret[0] == expected_return_code, "output was: {}".format(ret[1])
|
assert ret[0] == expected_return_code
|
||||||
assert _norm_out(ret[1]) == expected
|
assert _norm_out(ret[1]) == expected
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -271,11 +271,8 @@ def test_golang_hook(tempdir_factory, store):
|
||||||
def test_golang_hook_still_works_when_gobin_is_set(tempdir_factory, store):
|
def test_golang_hook_still_works_when_gobin_is_set(tempdir_factory, store):
|
||||||
gobin_dir = tempdir_factory.get()
|
gobin_dir = tempdir_factory.get()
|
||||||
with envcontext([('GOBIN', gobin_dir)]):
|
with envcontext([('GOBIN', gobin_dir)]):
|
||||||
_test_hook_repo(
|
test_golang_hook(tempdir_factory, store)
|
||||||
tempdir_factory, store, 'golang_hooks_repo',
|
assert os.listdir(gobin_dir) == []
|
||||||
'golang-hook', [], b'hello world\n',
|
|
||||||
)
|
|
||||||
assert os.listdir(gobin_dir) == [], "hook must not be installed in $GOBIN"
|
|
||||||
|
|
||||||
|
|
||||||
def test_rust_hook(tempdir_factory, store):
|
def test_rust_hook(tempdir_factory, store):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue