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

Method create

pre_commit/hook.py:49–57  ·  view source on GitHub ↗
(cls, src: str, prefix: Prefix, dct: dict[str, Any])

Source from the content-addressed store, hash-verified

47
48 @classmethod
49 def create(cls, src: str, prefix: Prefix, dct: dict[str, Any]) -> Hook:
50 # TODO: have cfgv do this (?)
51 extra_keys = set(dct) - _KEYS
52 if extra_keys:
53 logger.warning(
54 f'Unexpected key(s) present on {src} => {dct["id"]}: '
55 f'{", ".join(sorted(extra_keys))}',
56 )
57 return cls(src=src, prefix=prefix, **{k: dct[k] for k in _KEYS})
58
59
60_KEYS = frozenset(set(Hook._fields) - {'src', 'prefix'})

Callers 2

_cloned_repository_hooksFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected