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

Function _format_env

commitizen/hooks.py:26–35  ·  view source on GitHub ↗

_format_env() prefixes all given environment variables with the given prefix so it can be passed directly to cmd.run().

(prefix: str, env: Mapping[str, object])

Source from the content-addressed store, hash-verified

24
25
26def _format_env(prefix: str, env: Mapping[str, object]) -> dict[str, str]:
27 """_format_env() prefixes all given environment variables with the given
28 prefix so it can be passed directly to cmd.run()."""
29 penv = dict(os.environ)
30 for name, value in env.items():
31 name = prefix + name.upper()
32 value = str(value) if value is not None else ""
33 penv[name] = value
34
35 return penv

Callers 1

runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…