mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Implement concurrent execution of individual hooks
This commit is contained in:
parent
1f1cd2bc39
commit
ba5e27e4ec
15 changed files with 104 additions and 14 deletions
|
|
@ -1,5 +1,6 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import multiprocessing
|
||||
import shlex
|
||||
|
||||
from pre_commit.util import cmd_output
|
||||
|
|
@ -45,3 +46,11 @@ def basic_healthy(prefix, language_version):
|
|||
|
||||
def no_install(prefix, version, additional_dependencies):
|
||||
raise AssertionError('This type is not installable')
|
||||
|
||||
|
||||
def target_concurrency(hook):
|
||||
if hook['require_serial']:
|
||||
return 1
|
||||
else:
|
||||
# TODO: something smart!
|
||||
return multiprocessing.cpu_count()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue