mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 00:04:42 +04:00
add types_or
This commit is contained in:
parent
3112e08088
commit
62f668fc3f
13 changed files with 45 additions and 10 deletions
|
|
@ -219,6 +219,19 @@ def test_types_hook_repository(cap_out, store, tempdir_factory):
|
|||
assert b'bar.notpy' not in printed
|
||||
|
||||
|
||||
def test_types_or_hook_repository(cap_out, store, tempdir_factory):
|
||||
git_path = make_consuming_repo(tempdir_factory, 'types_or_repo')
|
||||
with cwd(git_path):
|
||||
stage_a_file('bar.notpy')
|
||||
stage_a_file('bar.pxd')
|
||||
stage_a_file('bar.py')
|
||||
ret, printed = _do_run(cap_out, store, git_path, run_opts())
|
||||
assert ret == 1
|
||||
assert b'bar.notpy' not in printed
|
||||
assert b'bar.pxd' in printed
|
||||
assert b'bar.py' in printed
|
||||
|
||||
|
||||
def test_exclude_types_hook_repository(cap_out, store, tempdir_factory):
|
||||
git_path = make_consuming_repo(tempdir_factory, 'exclude_types_repo')
|
||||
with cwd(git_path):
|
||||
|
|
|
|||
|
|
@ -901,6 +901,7 @@ def test_manifest_hooks(tempdir_factory, store):
|
|||
'post-commit', 'manual', 'post-checkout', 'push',
|
||||
),
|
||||
types=['file'],
|
||||
types_or=['file'],
|
||||
verbose=False,
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue