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

Function _non_cloned_repository_hooks

pre_commit/repository.py:147–168  ·  view source on GitHub ↗
(
        repo_config: dict[str, Any],
        store: Store,
        root_config: dict[str, Any],
)

Source from the content-addressed store, hash-verified

145
146
147def _non_cloned_repository_hooks(
148 repo_config: dict[str, Any],
149 store: Store,
150 root_config: dict[str, Any],
151) -> tuple[Hook, ...]:
152 def _prefix(language_name: str, deps: Sequence[str]) -> Prefix:
153 language = languages[language_name]
154 # pygrep / script / system / docker_image do not have
155 # environments so they work out of the current directory
156 if language.ENVIRONMENT_DIR is None:
157 return Prefix(os.getcwd())
158 else:
159 return Prefix(store.make_local(deps))
160
161 return tuple(
162 Hook.create(
163 repo_config['repo'],
164 _prefix(hook['language'], hook['additional_dependencies']),
165 _hook(hook, root_config=root_config),
166 )
167 for hook in repo_config['hooks']
168 )
169
170
171def _cloned_repository_hooks(

Callers 1

_repository_hooksFunction · 0.85

Calls 3

_prefixFunction · 0.85
_hookFunction · 0.85
createMethod · 0.80

Tested by

no test coverage detected