Short-circuit hooks

This commit is contained in:
Max R 2023-09-09 21:51:59 -04:00 committed by Anthony Sottile
parent 0845e4e816
commit 5d692d7e06
4 changed files with 41 additions and 39 deletions

View file

@ -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