mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-09 12:54:17 +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
|
@entry
|
||||||
def check_yaml(argv):
|
def check_yaml(argv):
|
||||||
parser = argparse.ArgumentParser()
|
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)
|
args = parser.parse_args(argv)
|
||||||
|
|
||||||
retval = 0
|
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