Fix #238 : pre-commit autoupdate fails with local hooks

This commit is contained in:
Lucas Cimon 2015-06-02 21:43:30 +02:00
parent 1c46446427
commit b575cb510c
5 changed files with 30 additions and 14 deletions

View file

@ -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:

View file

@ -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):