mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Making it possible to invoke pre-commit run --files some.file from a subdirectory of the repository
This commit is contained in:
parent
894862462d
commit
941149942d
3 changed files with 11 additions and 3 deletions
|
|
@ -83,7 +83,8 @@ def _do_run(repo, args, environ={}):
|
|||
runner = Runner(repo)
|
||||
write_mock = mock.Mock()
|
||||
write_fn = functools.partial(sys_stdout_write_wrapper, stream=write_mock)
|
||||
ret = run(runner, args, write=write_fn, environ=environ)
|
||||
with cwd(runner.git_root): # replicates Runner.create behaviour
|
||||
ret = run(runner, args, write=write_fn, environ=environ)
|
||||
printed = get_write_mock_output(write_mock)
|
||||
return ret, printed
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue