Skip to content

Commit 0e851bd

Browse files
authored
Merge pull request pre-commit#1535 from pre-commit/require_healthy_after_install
require healthy() after installation
2 parents 2f1d4d1 + 7da7256 commit 0e851bd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pre_commit/repository.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ def _hook_install(hook: Hook) -> None:
8282
lang.install_environment(
8383
hook.prefix, hook.language_version, hook.additional_dependencies,
8484
)
85+
if not lang.healthy(hook.prefix, hook.language_version):
86+
raise AssertionError(
87+
f'BUG: expected environment for {hook.language} to be healthy() '
88+
f'immediately after install, please open an issue describing '
89+
f'your environment',
90+
)
8591
# Write our state to indicate we're installed
8692
_write_state(hook.prefix, venv, _state(hook.additional_dependencies))
8793

0 commit comments

Comments
 (0)