mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-06 03:56:54 +00:00
Remove @entry decorator (and misc cleanup)
This commit is contained in:
parent
9bfa01da81
commit
2f1d2bbe5b
13 changed files with 25 additions and 88 deletions
|
|
@ -4,11 +4,8 @@ import argparse
|
|||
import sys
|
||||
import yaml
|
||||
|
||||
from pre_commit_hooks.util import entry
|
||||
|
||||
|
||||
@entry
|
||||
def check_yaml(argv):
|
||||
def check_yaml(argv=None):
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('filenames', nargs='*', help='Yaml filenames to check.')
|
||||
args = parser.parse_args(argv)
|
||||
|
|
@ -17,8 +14,8 @@ def check_yaml(argv):
|
|||
for filename in args.filenames:
|
||||
try:
|
||||
yaml.load(open(filename))
|
||||
except yaml.YAMLError as e:
|
||||
print(e)
|
||||
except yaml.YAMLError as exc:
|
||||
print(exc)
|
||||
retval = 1
|
||||
return retval
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue