mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-03-29 10:16:52 +00:00
check_yaml should not require any arguments.
This commit is contained in:
parent
f78ea7200d
commit
63b595ec2c
2 changed files with 13 additions and 1 deletions
|
|
@ -9,7 +9,7 @@ from pre_commit_hooks.util import entry
|
|||
@entry
|
||||
def check_yaml(argv):
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('filenames', nargs='+', help='Filenames to check.')
|
||||
parser.add_argument('filenames', nargs='*', help='Filenames to check.')
|
||||
args = parser.parse_args(argv)
|
||||
|
||||
retval = 0
|
||||
|
|
|
|||
12
tests/meta_test.py
Normal file
12
tests/meta_test.py
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
|
||||
import subprocess
|
||||
|
||||
from pre_commit.clientlib.validate_manifest import load_manifest
|
||||
|
||||
|
||||
def test_all_hooks_allow_no_files():
|
||||
manifest = load_manifest('hooks.yaml')
|
||||
|
||||
for hook in manifest:
|
||||
if hook['id'] != 'pyflakes':
|
||||
subprocess.check_call([hook['entry']])
|
||||
Loading…
Add table
Add a link
Reference in a new issue