There was an error while loading. Please reload this page.
1 parent 6a177c4 commit ae5b74aCopy full SHA for ae5b74a
2 files changed
pre_commit/meta_hooks/check_hooks_apply.py
@@ -14,6 +14,8 @@ def check_all_hooks_match_files(config_file):
14
15
for repo in runner.repositories:
16
for hook_id, hook in repo.hooks:
17
+ if hook['always_run']:
18
+ continue
19
include, exclude = hook['files'], hook['exclude']
20
filtered = _filter_by_include_exclude(files, include, exclude)
21
types, exclude_types = hook['types'], hook['exclude_types']
tests/meta_hooks/check_hooks_apply_test.py
@@ -116,6 +116,12 @@ def test_valid_includes(
116
OrderedDict((
117
('id', 'check-useless-excludes'),
118
)),
119
+ # Should not be reported as an error due to always_run
120
+ OrderedDict((
121
+ ('id', 'check-useless-excludes'),
122
+ ('files', '^$'),
123
+ ('always_run', True),
124
+ )),
125
),
126
127
))
0 commit comments