MCPcopy Index your code
hub / github.com/pre-commit/pre-commit / _hook_installed

Function _hook_installed

pre_commit/repository.py:46–62  ·  view source on GitHub ↗
(hook: Hook)

Source from the content-addressed store, hash-verified

44
45
46def _hook_installed(hook: Hook) -> bool:
47 lang = languages[hook.language]
48 if lang.ENVIRONMENT_DIR is None:
49 return True
50
51 venv = environment_dir(
52 hook.prefix,
53 lang.ENVIRONMENT_DIR,
54 hook.language_version,
55 )
56 return (
57 (
58 os.path.exists(_state_filename_v2(venv)) or
59 _read_state(venv) == _state(hook.additional_dependencies)
60 ) and
61 not lang.health_check(hook.prefix, hook.language_version)
62 )
63
64
65def _hook_install(hook: Hook) -> None:

Callers 2

_need_installedFunction · 0.85

Calls 6

environment_dirFunction · 0.90
_state_filename_v2Function · 0.85
_read_stateFunction · 0.85
_stateFunction · 0.85
existsMethod · 0.80
health_checkMethod · 0.80

Tested by 1