mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Merge pull request #387 from pre-commit/better_suggest_autoupdate
Clarify language around missing hooks. Resolves #386
This commit is contained in:
commit
ea05189c28
2 changed files with 6 additions and 2 deletions
|
|
@ -78,7 +78,9 @@ class Repository(object):
|
||||||
logger.error(
|
logger.error(
|
||||||
'`{0}` is not present in repository {1}. '
|
'`{0}` is not present in repository {1}. '
|
||||||
'Typo? Perhaps it is introduced in a newer version? '
|
'Typo? Perhaps it is introduced in a newer version? '
|
||||||
'Often `pre-commit autoupdate` fixes this.'.format(
|
'Often you can fix this by removing the hook, running '
|
||||||
|
'`pre-commit autoupdate`, '
|
||||||
|
'and then adding the hook.'.format(
|
||||||
hook['id'], self.repo_config['repo'],
|
hook['id'], self.repo_config['repo'],
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -556,7 +556,9 @@ def test_hook_id_not_present(tempdir_factory, store, fake_log_handler):
|
||||||
assert fake_log_handler.handle.call_args[0][0].msg == (
|
assert fake_log_handler.handle.call_args[0][0].msg == (
|
||||||
'`i-dont-exist` is not present in repository {0}. '
|
'`i-dont-exist` is not present in repository {0}. '
|
||||||
'Typo? Perhaps it is introduced in a newer version? '
|
'Typo? Perhaps it is introduced in a newer version? '
|
||||||
'Often `pre-commit autoupdate` fixes this.'.format(path)
|
'Often you can fix this by removing the hook, '
|
||||||
|
'running `pre-commit autoupdate`, '
|
||||||
|
'and then adding the hook.'.format(path)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue