Skip to content

Commit e99813f

Browse files
committed
Rename check-files-matches-any to check-hooks-apply
1 parent f098ec3 commit e99813f

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ repos:
2727
- id: add-trailing-comma
2828
- repo: meta
2929
hooks:
30+
- id: check-hooks-apply
3031
- id: check-useless-excludes
31-
- id: check-files-matches-any
File renamed without changes.

pre_commit/repository.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ class MetaRepository(LocalRepository):
255255
@cached_property
256256
def manifest_hooks(self):
257257
# The hooks are imported here to prevent circular imports.
258-
from pre_commit.meta_hooks import check_files_matches_any
258+
from pre_commit.meta_hooks import check_hooks_apply
259259
from pre_commit.meta_hooks import check_useless_excludes
260260

261261
def _make_entry(mod):
@@ -267,11 +267,11 @@ def _make_entry(mod):
267267

268268
meta_hooks = [
269269
{
270-
'id': 'check-files-matches-any',
271-
'name': 'Check hooks match any files',
270+
'id': 'check-hooks-apply',
271+
'name': 'Check hooks apply to the repository',
272272
'files': '.pre-commit-config.yaml',
273273
'language': 'system',
274-
'entry': _make_entry(check_files_matches_any),
274+
'entry': _make_entry(check_hooks_apply),
275275
},
276276
{
277277
'id': 'check-useless-excludes',

tests/meta_hooks/hook_matches_any_test.py renamed to tests/meta_hooks/check_hooks_apply_test.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from collections import OrderedDict
22

3-
from pre_commit.meta_hooks import check_files_matches_any
3+
from pre_commit.meta_hooks import check_hooks_apply
44
from pre_commit.util import cwd
55
from testing.fixtures import add_config_to_repo
66
from testing.fixtures import git_dir
@@ -25,7 +25,7 @@ def test_hook_excludes_everything(
2525
add_config_to_repo(repo, config)
2626

2727
with cwd(repo):
28-
assert check_files_matches_any.main(()) == 1
28+
assert check_hooks_apply.main(()) == 1
2929

3030
out, _ = capsys.readouterr()
3131
assert 'check-useless-excludes does not apply to this repository' in out
@@ -50,7 +50,7 @@ def test_hook_includes_nothing(
5050
add_config_to_repo(repo, config)
5151

5252
with cwd(repo):
53-
assert check_files_matches_any.main(()) == 1
53+
assert check_hooks_apply.main(()) == 1
5454

5555
out, _ = capsys.readouterr()
5656
assert 'check-useless-excludes does not apply to this repository' in out
@@ -75,7 +75,7 @@ def test_hook_types_not_matched(
7575
add_config_to_repo(repo, config)
7676

7777
with cwd(repo):
78-
assert check_files_matches_any.main(()) == 1
78+
assert check_hooks_apply.main(()) == 1
7979

8080
out, _ = capsys.readouterr()
8181
assert 'check-useless-excludes does not apply to this repository' in out
@@ -100,7 +100,7 @@ def test_hook_types_excludes_everything(
100100
add_config_to_repo(repo, config)
101101

102102
with cwd(repo):
103-
assert check_files_matches_any.main(()) == 1
103+
assert check_hooks_apply.main(()) == 1
104104

105105
out, _ = capsys.readouterr()
106106
assert 'check-useless-excludes does not apply to this repository' in out
@@ -124,7 +124,7 @@ def test_valid_includes(
124124
add_config_to_repo(repo, config)
125125

126126
with cwd(repo):
127-
assert check_files_matches_any.main(()) == 0
127+
assert check_hooks_apply.main(()) == 0
128128

129129
out, _ = capsys.readouterr()
130130
assert out == ''

0 commit comments

Comments
 (0)