Add types to manifests, make it and files optional

This commit is contained in:
Chris Kuehl 2016-01-06 16:49:42 -08:00 committed by Chris Kuehl
parent cebba0404d
commit a4e9394cc7
3 changed files with 18 additions and 5 deletions

View file

@ -44,6 +44,10 @@ CONFIG_JSON_SCHEMA = {
'type': 'array',
'items': {'type': 'string'},
},
'types': {
'type': 'array',
'items': {'type': 'string'}
},
},
'required': ['id'],
}

View file

@ -27,7 +27,11 @@ MANIFEST_JSON_SCHEMA = {
'minimum_pre_commit_version': {
'type': 'string', 'default': '0.0.0',
},
'files': {'type': 'string'},
'files': {
'type': 'string',
# empty regex to match all files
'default': '',
},
'stages': {
'type': 'array',
'default': [],
@ -35,19 +39,22 @@ MANIFEST_JSON_SCHEMA = {
'type': 'string',
},
},
'types': {
'type': 'array',
'items': {'type': 'string'},
'default': ['file'],
},
'args': {
'type': 'array',
'default': [],
'items': {
'type': 'string',
},
'items': {'type': 'string'},
},
'additional_dependencies': {
'type': 'array',
'items': {'type': 'string'},
},
},
'required': ['id', 'name', 'entry', 'language', 'files'],
'required': ['id', 'name', 'entry', 'language'],
},
}

View file

@ -25,6 +25,7 @@ def test_manifest_contents(manifest):
'entry': 'bin/hook.sh',
'exclude': '^$',
'files': '',
'types': ['file'],
'id': 'bash_hook',
'language': 'script',
'language_version': 'default',
@ -42,6 +43,7 @@ def test_hooks(manifest):
'entry': 'bin/hook.sh',
'exclude': '^$',
'files': '',
'types': ['file'],
'id': 'bash_hook',
'language': 'script',
'language_version': 'default',