mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Remove @entry
This commit is contained in:
parent
9a017dcbe9
commit
32817f3958
6 changed files with 10 additions and 52 deletions
|
|
@ -7,7 +7,6 @@ import os
|
|||
import os.path
|
||||
import pkg_resources
|
||||
import shutil
|
||||
import sys
|
||||
import tarfile
|
||||
import tempfile
|
||||
|
||||
|
|
@ -29,19 +28,6 @@ def memoize_by_cwd(func):
|
|||
return wrapper
|
||||
|
||||
|
||||
def entry(func):
|
||||
"""Allows a function that has `argv` as an argument to be used as a
|
||||
commandline entry. This will make the function callable using either
|
||||
explicitly passed argv or defaulting to sys.argv[1:]
|
||||
"""
|
||||
@functools.wraps(func)
|
||||
def wrapper(argv=None):
|
||||
if argv is None:
|
||||
argv = sys.argv[1:]
|
||||
return func(argv)
|
||||
return wrapper
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def clean_path_on_failure(path):
|
||||
"""Cleans up the directory on an exceptional failure."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue