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

Function test_manifest_hooks

tests/repository_test.py:409–451  ·  view source on GitHub ↗
(tempdir_factory, store)

Source from the content-addressed store, hash-verified

407
408
409def test_manifest_hooks(tempdir_factory, store):
410 path = make_repo(tempdir_factory, 'script_hooks_repo')
411 config = make_config_from_repo(path)
412 hook = _get_hook(config, store, 'bash_hook')
413
414 assert hook == Hook(
415 src=f'file://{path}',
416 prefix=Prefix(mock.ANY),
417 additional_dependencies=[],
418 alias='',
419 always_run=False,
420 args=[],
421 description='',
422 entry='bin/hook.sh',
423 exclude='^$',
424 exclude_types=[],
425 files='',
426 id='bash_hook',
427 language='unsupported_script',
428 language_version='default',
429 log_file='',
430 minimum_pre_commit_version='0',
431 name='Bash hook',
432 pass_filenames=True,
433 require_serial=False,
434 stages=[
435 'commit-msg',
436 'post-checkout',
437 'post-commit',
438 'post-merge',
439 'post-rewrite',
440 'pre-commit',
441 'pre-merge-commit',
442 'pre-push',
443 'pre-rebase',
444 'prepare-commit-msg',
445 'manual',
446 ],
447 types=['file'],
448 types_or=[],
449 verbose=False,
450 fail_fast=False,
451 )
452
453
454def test_non_installable_hook_error_for_language_version(store, caplog):

Callers

nothing calls this directly

Calls 5

make_repoFunction · 0.90
make_config_from_repoFunction · 0.90
HookClass · 0.90
PrefixClass · 0.90
_get_hookFunction · 0.85

Tested by

no test coverage detected