Use Hook api in languages

This commit is contained in:
Anthony Sottile 2018-12-31 13:16:48 -08:00
parent 5f9a667470
commit b59d7197ff
18 changed files with 41 additions and 38 deletions

View file

@ -26,7 +26,7 @@ def environment_dir(ENVIRONMENT_DIR, language_version):
def to_cmd(hook):
return tuple(shlex.split(hook['entry'])) + tuple(hook['args'])
return tuple(shlex.split(hook.entry)) + tuple(hook.args)
def assert_version_default(binary, version):
@ -57,7 +57,7 @@ def no_install(prefix, version, additional_dependencies):
def target_concurrency(hook):
if hook['require_serial'] or 'PRE_COMMIT_NO_CONCURRENCY' in os.environ:
if hook.require_serial or 'PRE_COMMIT_NO_CONCURRENCY' in os.environ:
return 1
else:
# Travis appears to have a bunch of CPUs, but we can't use them all.