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

Skip to content

Commit c08400e

Browse files
committed
Improve messaging for missing hook given #480
1 parent cf1fa70 commit c08400e

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

pre_commit/repository.py

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

tests/repository_test.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -696,9 +696,7 @@ def test_hook_id_not_present(tempdir_factory, store, fake_log_handler):
696696
assert fake_log_handler.handle.call_args[0][0].msg == (
697697
'`i-dont-exist` is not present in repository {}. '
698698
'Typo? Perhaps it is introduced in a newer version? '
699-
'Often you can fix this by removing the hook, '
700-
'running `pre-commit autoupdate`, '
701-
'and then adding the hook.'.format(path)
699+
'Often `pre-commit autoupdate` fixes this.'.format(path)
702700
)
703701

704702

0 commit comments

Comments
 (0)