Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 111ed02

Browse files
committed
git mv pre_commit/run.py pre_commit/main.py
1 parent 13c1b52 commit 111ed02

3 files changed

Lines changed: 6 additions & 7 deletions

File tree

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import argparse
2-
import sys
32

43
from pre_commit import color
54
from pre_commit import commands
@@ -8,7 +7,7 @@
87

98

109
@entry
11-
def run(argv):
10+
def main(argv):
1211
parser = argparse.ArgumentParser()
1312

1413
subparsers = parser.add_subparsers(dest='command')
@@ -77,4 +76,4 @@ def run(argv):
7776

7877

7978
if __name__ == '__main__':
80-
sys.exit(run())
79+
exit(main())

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
],
4545
entry_points={
4646
'console_scripts': [
47-
'pre-commit = pre_commit.run:run',
47+
'pre-commit = pre_commit.main:main',
4848
'validate-config = pre_commit.clientlib.validate_config:run',
4949
'validate-manifest = pre_commit.clientlib.validate_manifest:run',
5050
],

tests/git_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def test_cherry_pick_conflict(in_merge_conflict):
3333
def get_files_matching_func():
3434
def get_filenames():
3535
return (
36-
'pre_commit/run.py',
36+
'pre_commit/main.py',
3737
'pre_commit/git.py',
3838
'im_a_file_that_doesnt_exist.py',
3939
'hooks.yaml',
@@ -45,7 +45,7 @@ def get_filenames():
4545
def test_get_files_matching_base(get_files_matching_func):
4646
ret = get_files_matching_func('', '^$')
4747
assert ret == set([
48-
'pre_commit/run.py',
48+
'pre_commit/main.py',
4949
'pre_commit/git.py',
5050
'hooks.yaml',
5151
])
@@ -54,7 +54,7 @@ def test_get_files_matching_base(get_files_matching_func):
5454
def test_get_files_matching_total_match(get_files_matching_func):
5555
ret = get_files_matching_func('^.*\\.py$', '^$')
5656
assert ret == set([
57-
'pre_commit/run.py',
57+
'pre_commit/main.py',
5858
'pre_commit/git.py',
5959
])
6060

0 commit comments

Comments
 (0)