mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-18 08:34:41 +04:00
Short-circuit hooks
This commit is contained in:
parent
0845e4e816
commit
5d692d7e06
4 changed files with 41 additions and 39 deletions
|
|
@ -21,7 +21,7 @@ def check_all_hooks_match_files(config_file: str) -> int:
|
|||
for hook in all_hooks(config, Store()):
|
||||
if hook.always_run or hook.language == 'fail':
|
||||
continue
|
||||
elif not classifier.filenames_for_hook(hook):
|
||||
elif not any(classifier.filenames_for_hook(hook)):
|
||||
print(f'{hook.id} does not apply to this repository')
|
||||
retv = 1
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue