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

Function format_env

pre_commit/envcontext.py:25–29  ·  view source on GitHub ↗
(parts: SubstitutionT, env: MutableMapping[str, str])

Source from the content-addressed store, hash-verified

23
24
25def format_env(parts: SubstitutionT, env: MutableMapping[str, str]) -> str:
26 return ''.join(
27 env.get(part.name, part.default) if isinstance(part, Var) else part
28 for part in parts
29 )
30
31
32@contextlib.contextmanager

Callers 1

envcontextFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected