mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Fix #238 : pre-commit autoupdate fails with local hooks
This commit is contained in:
parent
1c46446427
commit
b575cb510c
5 changed files with 30 additions and 14 deletions
|
|
@ -8,6 +8,7 @@ from aspy.yaml import ordered_load
|
|||
|
||||
import pre_commit.constants as C
|
||||
from pre_commit.clientlib.validate_config import CONFIG_JSON_SCHEMA
|
||||
from pre_commit.clientlib.validate_config import is_local_hooks
|
||||
from pre_commit.clientlib.validate_config import load_config
|
||||
from pre_commit.jsonschema_extensions import remove_defaults
|
||||
from pre_commit.ordereddict import OrderedDict
|
||||
|
|
@ -67,6 +68,8 @@ def autoupdate(runner):
|
|||
)
|
||||
|
||||
for repo_config in input_configs:
|
||||
if is_local_hooks(repo_config):
|
||||
continue
|
||||
sys.stdout.write('Updating {0}...'.format(repo_config['repo']))
|
||||
sys.stdout.flush()
|
||||
try:
|
||||
|
|
|
|||
|
|
@ -125,9 +125,8 @@ class Repository(object):
|
|||
|
||||
|
||||
class LocalRepository(Repository):
|
||||
def __init__(self, repo_config, repo_path_getter=None):
|
||||
repo_path_getter = None
|
||||
super(LocalRepository, self).__init__(repo_config, repo_path_getter)
|
||||
def __init__(self, repo_config):
|
||||
super(LocalRepository, self).__init__(repo_config, None)
|
||||
|
||||
@cached_property
|
||||
def hooks(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue