mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-14 04:50:20 -06:00
Merge pull request #481 from pre-commit/improve_messaging_for_nonexistent_hook
Improve messaging for missing hook given #480
This commit is contained in:
@@ -78,9 +78,7 @@ class Repository(object):
|
||||
logger.error(
|
||||
'`{}` is not present in repository {}. '
|
||||
'Typo? Perhaps it is introduced in a newer version? '
|
||||
'Often you can fix this by removing the hook, running '
|
||||
'`pre-commit autoupdate`, '
|
||||
'and then adding the hook.'.format(
|
||||
'Often `pre-commit autoupdate` fixes this.'.format(
|
||||
hook['id'], self.repo_config['repo'],
|
||||
)
|
||||
)
|
||||
|
||||
@@ -696,9 +696,7 @@ def test_hook_id_not_present(tempdir_factory, store, fake_log_handler):
|
||||
assert fake_log_handler.handle.call_args[0][0].msg == (
|
||||
'`i-dont-exist` is not present in repository {}. '
|
||||
'Typo? Perhaps it is introduced in a newer version? '
|
||||
'Often you can fix this by removing the hook, '
|
||||
'running `pre-commit autoupdate`, '
|
||||
'and then adding the hook.'.format(path)
|
||||
'Often `pre-commit autoupdate` fixes this.'.format(path)
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user