Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5547db9

Browse files
committed
Clarify language around missing hooks. Resolves #386
1 parent 99edd0d commit 5547db9

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

pre_commit/repository.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ def hooks(self):
7878
logger.error(
7979
'`{0}` is not present in repository {1}. '
8080
'Typo? Perhaps it is introduced in a newer version? '
81-
'Often `pre-commit autoupdate` fixes this.'.format(
81+
'Often you can fix this by removing the hook, running '
82+
'`pre-commit autoupdate`, '
83+
'and then adding the hook.'.format(
8284
hook['id'], self.repo_config['repo'],
8385
)
8486
)

tests/repository_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,9 @@ def test_hook_id_not_present(tempdir_factory, store, fake_log_handler):
556556
assert fake_log_handler.handle.call_args[0][0].msg == (
557557
'`i-dont-exist` is not present in repository {0}. '
558558
'Typo? Perhaps it is introduced in a newer version? '
559-
'Often `pre-commit autoupdate` fixes this.'.format(path)
559+
'Often you can fix this by removing the hook, '
560+
'running `pre-commit autoupdate`, '
561+
'and then adding the hook.'.format(path)
560562
)
561563

562564

0 commit comments

Comments
 (0)