mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Performance hack
This commit is contained in:
parent
1a8095e71e
commit
6b62ec47e8
1 changed files with 1 additions and 14 deletions
|
|
@ -1,6 +1,5 @@
|
|||
|
||||
from plumbum import local
|
||||
import subprocess
|
||||
|
||||
PY_ENV = 'py_env'
|
||||
|
||||
|
|
@ -17,21 +16,9 @@ def install_environment():
|
|||
|
||||
|
||||
def run_hook(hook, file_args):
|
||||
# TODO: batch filenames
|
||||
process = subprocess.Popen(
|
||||
['bash', '-c', ' '.join(
|
||||
['source {0}/bin/activate &&'.format(PY_ENV)] +
|
||||
[hook['entry']] + hook.get('args', []) + list(file_args)
|
||||
)],
|
||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
||||
)
|
||||
ret = process.communicate()
|
||||
|
||||
return (process.returncode,) + ret
|
||||
|
||||
return local['bash'][
|
||||
'-c', ' '.join(
|
||||
['source {0}/bin/activate &&'.format(PY_ENV)] +
|
||||
[hook['entry']] + hook.get('args', []) + list(file_args)
|
||||
)
|
||||
].run()
|
||||
].run()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue