mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
git mv pre_commit/run.py pre_commit/main.py
This commit is contained in:
parent
13c1b5295c
commit
111ed02938
3 changed files with 6 additions and 7 deletions
|
|
@ -1,5 +1,4 @@
|
|||
import argparse
|
||||
import sys
|
||||
|
||||
from pre_commit import color
|
||||
from pre_commit import commands
|
||||
|
|
@ -8,7 +7,7 @@ from pre_commit.util import entry
|
|||
|
||||
|
||||
@entry
|
||||
def run(argv):
|
||||
def main(argv):
|
||||
parser = argparse.ArgumentParser()
|
||||
|
||||
subparsers = parser.add_subparsers(dest='command')
|
||||
|
|
@ -77,4 +76,4 @@ def run(argv):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(run())
|
||||
exit(main())
|
||||
2
setup.py
2
setup.py
|
|
@ -44,7 +44,7 @@ setup(
|
|||
],
|
||||
entry_points={
|
||||
'console_scripts': [
|
||||
'pre-commit = pre_commit.run:run',
|
||||
'pre-commit = pre_commit.main:main',
|
||||
'validate-config = pre_commit.clientlib.validate_config:run',
|
||||
'validate-manifest = pre_commit.clientlib.validate_manifest:run',
|
||||
],
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ def test_cherry_pick_conflict(in_merge_conflict):
|
|||
def get_files_matching_func():
|
||||
def get_filenames():
|
||||
return (
|
||||
'pre_commit/run.py',
|
||||
'pre_commit/main.py',
|
||||
'pre_commit/git.py',
|
||||
'im_a_file_that_doesnt_exist.py',
|
||||
'hooks.yaml',
|
||||
|
|
@ -45,7 +45,7 @@ def get_files_matching_func():
|
|||
def test_get_files_matching_base(get_files_matching_func):
|
||||
ret = get_files_matching_func('', '^$')
|
||||
assert ret == set([
|
||||
'pre_commit/run.py',
|
||||
'pre_commit/main.py',
|
||||
'pre_commit/git.py',
|
||||
'hooks.yaml',
|
||||
])
|
||||
|
|
@ -54,7 +54,7 @@ def test_get_files_matching_base(get_files_matching_func):
|
|||
def test_get_files_matching_total_match(get_files_matching_func):
|
||||
ret = get_files_matching_func('^.*\\.py$', '^$')
|
||||
assert ret == set([
|
||||
'pre_commit/run.py',
|
||||
'pre_commit/main.py',
|
||||
'pre_commit/git.py',
|
||||
])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue