mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Remove unnecessary object level at top of manifest
This commit is contained in:
parent
af7e23aae5
commit
e5f4c61608
4 changed files with 54 additions and 66 deletions
|
|
@ -11,31 +11,25 @@ class InvalidManifestError(ValueError): pass
|
|||
|
||||
|
||||
MANIFEST_JSON_SCHEMA = {
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'hooks': {
|
||||
'type': 'array',
|
||||
'minItems': 1,
|
||||
'items': {
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'id': {'type': 'string'},
|
||||
'name': {'type': 'string'},
|
||||
'description': {'type': 'string'},
|
||||
'entry': {'type': 'string'},
|
||||
'language': {'type': 'string'},
|
||||
'expected_return_value': {'type': 'number'},
|
||||
},
|
||||
'required': ['id', 'name', 'entry'],
|
||||
},
|
||||
'type': 'array',
|
||||
'minItems': 1,
|
||||
'items': {
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'id': {'type': 'string'},
|
||||
'name': {'type': 'string'},
|
||||
'description': {'type': 'string'},
|
||||
'entry': {'type': 'string'},
|
||||
'language': {'type': 'string'},
|
||||
'expected_return_value': {'type': 'number'},
|
||||
},
|
||||
'required': ['id', 'name', 'entry'],
|
||||
},
|
||||
'required': ['hooks'],
|
||||
}
|
||||
|
||||
|
||||
def additional_manifest_check(obj):
|
||||
for hook_config in obj['hooks']:
|
||||
for hook_config in obj:
|
||||
language = hook_config.get('language')
|
||||
|
||||
if language is not None and not any(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue