give docker a tty output when expecting color

this makes the behavior more consistent with the system language
and would help the executable run in a docker container to
produce a colored output.
This commit is contained in:
Gaëtan Lehmann 2024-02-07 11:18:24 +01:00 committed by Anthony Sottile
parent 7b868c3508
commit e58009684c
3 changed files with 32 additions and 3 deletions

View file

@ -23,7 +23,7 @@ def run_hook(
require_serial: bool,
color: bool,
) -> tuple[int, bytes]: # pragma: win32 no cover
cmd = docker_cmd() + lang_base.hook_cmd(entry, args)
cmd = docker_cmd(color=color) + lang_base.hook_cmd(entry, args)
return lang_base.run_xargs(
cmd,
file_args,