mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 16:24:40 +04:00
Remove @entry
This commit is contained in:
parent
9a017dcbe9
commit
32817f3958
6 changed files with 10 additions and 52 deletions
|
|
@ -6,10 +6,10 @@ import jsonschema
|
|||
import jsonschema.exceptions
|
||||
import os.path
|
||||
import re
|
||||
import sys
|
||||
import yaml
|
||||
|
||||
from pre_commit.jsonschema_extensions import apply_defaults
|
||||
from pre_commit.util import entry
|
||||
|
||||
|
||||
def is_regex_valid(regex):
|
||||
|
|
@ -64,8 +64,8 @@ def get_validator(
|
|||
|
||||
|
||||
def get_run_function(filenames_help, validate_strategy, exception_cls):
|
||||
@entry
|
||||
def run(argv):
|
||||
def run(argv=None):
|
||||
argv = argv if argv is not None else sys.argv[1:]
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('filenames', nargs='*', help=filenames_help)
|
||||
args = parser.parse_args(argv)
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import sys
|
||||
|
||||
from pre_commit.clientlib.validate_base import get_run_function
|
||||
from pre_commit.clientlib.validate_base import get_validator
|
||||
from pre_commit.clientlib.validate_base import is_regex_valid
|
||||
from pre_commit.errors import FatalError
|
||||
|
||||
|
||||
class InvalidConfigError(ValueError):
|
||||
class InvalidConfigError(FatalError):
|
||||
pass
|
||||
|
||||
|
||||
|
|
@ -71,4 +70,4 @@ run = get_run_function('Config filenames.', load_config, InvalidConfigError)
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(run())
|
||||
exit(run())
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import sys
|
||||
|
||||
from pre_commit.clientlib.validate_base import get_run_function
|
||||
from pre_commit.clientlib.validate_base import get_validator
|
||||
from pre_commit.clientlib.validate_base import is_regex_valid
|
||||
|
|
@ -74,4 +72,4 @@ run = get_run_function(
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(run())
|
||||
exit(run())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue