mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-05-11 19:10:22 -05:00
git mv pre_commit/run.py pre_commit/main.py
This commit is contained in:
@@ -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())
|
||||
@@ -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',
|
||||
],
|
||||
|
||||
+3
-3
@@ -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',
|
||||
])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user