From 5547db93ef028575dc091b80e1e8e09ec8611562 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sat, 25 Jun 2016 08:14:58 -0700 Subject: [PATCH] Clarify language around missing hooks. Resolves #386 --- pre_commit/repository.py | 4 +++- tests/repository_test.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pre_commit/repository.py b/pre_commit/repository.py index a0c0d01a..2fd2d826 100644 --- a/pre_commit/repository.py +++ b/pre_commit/repository.py @@ -78,7 +78,9 @@ class Repository(object): logger.error( '`{0}` is not present in repository {1}. ' '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'], ) ) diff --git a/tests/repository_test.py b/tests/repository_test.py index f86defcc..9e58b090 100644 --- a/tests/repository_test.py +++ b/tests/repository_test.py @@ -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 == ( '`i-dont-exist` is not present in repository {0}. ' '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) )