mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Add support for meta hooks
This commit is contained in:
parent
39d5205e31
commit
88c676a7c1
6 changed files with 130 additions and 1 deletions
|
|
@ -709,6 +709,18 @@ def test_hook_id_not_present(tempdir_factory, store, fake_log_handler):
|
|||
)
|
||||
|
||||
|
||||
def test_meta_hook_not_present(store, fake_log_handler):
|
||||
config = {'repo': 'meta', 'hooks': [{'id': 'i-dont-exist'}]}
|
||||
repo = Repository.create(config, store)
|
||||
with pytest.raises(SystemExit):
|
||||
repo.require_installed()
|
||||
assert fake_log_handler.handle.call_args[0][0].msg == (
|
||||
'`i-dont-exist` is not a valid meta hook. '
|
||||
'Typo? Perhaps it is introduced in a newer version? '
|
||||
'Often `pre-commit autoupdate` fixes this.'
|
||||
)
|
||||
|
||||
|
||||
def test_too_new_version(tempdir_factory, store, fake_log_handler):
|
||||
path = make_repo(tempdir_factory, 'script_hooks_repo')
|
||||
with modify_manifest(path) as manifest:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue