summaryrefslogtreecommitdiffstats
path: root/pre_commit/commands/run.py
diff options
context:
space:
mode:
Diffstat (limited to 'pre_commit/commands/run.py')
-rw-r--r--pre_commit/commands/run.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/pre_commit/commands/run.py b/pre_commit/commands/run.py
index 429e04c..e44e703 100644
--- a/pre_commit/commands/run.py
+++ b/pre_commit/commands/run.py
@@ -189,7 +189,16 @@ def _run_single_hook(
filenames = ()
time_before = time.time()
language = languages[hook.language]
- retcode, out = language.run_hook(hook, filenames, use_color)
+ with language.in_env(hook.prefix, hook.language_version):
+ retcode, out = language.run_hook(
+ hook.prefix,
+ hook.entry,
+ hook.args,
+ filenames,
+ is_local=hook.src == 'local',
+ require_serial=hook.require_serial,
+ color=use_color,
+ )
duration = round(time.time() - time_before, 2) or 0
diff_after = _get_diff()