Preparatory work & clean-up for #219

clientlib/validate_config.py: moving "sha" field requirement out of JSON schema
commands/run.py: code simplification
runner.py: made .config a cached_property
This commit is contained in:
LCM
2015-05-05 23:45:02 +02:00
committed by Lucas Cimon
parent aec1c55f68
commit 7dd8c6ab4a
2 changed files with 40 additions and 32 deletions

View File

@@ -37,7 +37,7 @@ CONFIG_JSON_SCHEMA = {
}
}
},
'required': ['repo', 'sha', 'hooks'],
'required': ['repo', 'hooks'],
}
}
@@ -53,6 +53,10 @@ def try_regex(repo, hook, value, field_name):
def validate_config_extra(config):
for repo in config:
if 'sha' not in repo:
raise InvalidConfigError(
'Missing "sha" field for repository {0}'.format(repo['repo'])
)
for hook in repo['hooks']:
try_regex(repo, hook['id'], hook.get('files', ''), 'files')
try_regex(repo, hook['id'], hook['exclude'], 'exclude')