mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-07 04:26:52 +00:00
Refactored how entry points work.
This commit is contained in:
parent
5db7f2d807
commit
45741545dc
8 changed files with 71 additions and 42 deletions
|
|
@ -3,7 +3,10 @@ from __future__ import print_function
|
|||
|
||||
import sys
|
||||
|
||||
from pre_commit_hooks.util import entry
|
||||
|
||||
|
||||
@entry
|
||||
def validate_files(argv):
|
||||
retcode = 0
|
||||
for filename in argv:
|
||||
|
|
@ -18,9 +21,5 @@ def validate_files(argv):
|
|||
return retcode
|
||||
|
||||
|
||||
def entry():
|
||||
return validate_files(sys.argv[1:])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(entry())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue