mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 16:24:40 +04:00
always_run hooks always apply to the repository
This commit is contained in:
parent
6a177c41ca
commit
ae5b74ad38
2 changed files with 8 additions and 0 deletions
|
|
@ -14,6 +14,8 @@ def check_all_hooks_match_files(config_file):
|
|||
|
||||
for repo in runner.repositories:
|
||||
for hook_id, hook in repo.hooks:
|
||||
if hook['always_run']:
|
||||
continue
|
||||
include, exclude = hook['files'], hook['exclude']
|
||||
filtered = _filter_by_include_exclude(files, include, exclude)
|
||||
types, exclude_types = hook['types'], hook['exclude_types']
|
||||
|
|
|
|||
|
|
@ -116,6 +116,12 @@ def test_valid_includes(
|
|||
OrderedDict((
|
||||
('id', 'check-useless-excludes'),
|
||||
)),
|
||||
# Should not be reported as an error due to always_run
|
||||
OrderedDict((
|
||||
('id', 'check-useless-excludes'),
|
||||
('files', '^$'),
|
||||
('always_run', True),
|
||||
)),
|
||||
),
|
||||
),
|
||||
))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue