MCPcopy Index your code
hub / github.com/commitizen-tools/commitizen / run

Function run

commitizen/hooks.py:13–23  ·  view source on GitHub ↗
(hooks: str | list[str], _env_prefix: str = "CZ_", **env: object)

Source from the content-addressed store, hash-verified

11
12
13def run(hooks: str | list[str], _env_prefix: str = "CZ_", **env: object) -> None:
14 if isinstance(hooks, str):
15 hooks = [hooks]
16
17 for hook in hooks:
18 out.info(f"Running hook '{hook}'")
19
20 return_code = cmd.run_interactive(hook, env=_format_env(_env_prefix, env))
21
22 if return_code != 0:
23 raise RunHookError(f"Running hook '{hook}' failed")
24
25
26def _format_env(prefix: str, env: Mapping[str, object]) -> dict[str, str]:

Callers

nothing calls this directly

Calls 3

RunHookErrorClass · 0.90
_format_envFunction · 0.85
infoMethod · 0.45

Tested by

no test coverage detected