check_yaml should not require any arguments.

This commit is contained in:
Anthony Sottile 2014-04-03 22:22:00 -07:00
parent f78ea7200d
commit 63b595ec2c
2 changed files with 13 additions and 1 deletions

View File

@ -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
View 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']])