check_yaml should not require any arguments.
diff --git a/pre_commit_hooks/check_yaml.py b/pre_commit_hooks/check_yaml.py index 210c6d6..c297ccf 100644 --- a/pre_commit_hooks/check_yaml.py +++ b/pre_commit_hooks/check_yaml.py
@@ -9,7 +9,7 @@ @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
diff --git a/tests/meta_test.py b/tests/meta_test.py new file mode 100644 index 0000000..773bb0d --- /dev/null +++ b/tests/meta_test.py
@@ -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']])