mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Make hooks specify files. Optionally allow config to override manifest.
This commit is contained in:
parent
0ec9020346
commit
96174deac6
25 changed files with 81 additions and 50 deletions
|
|
@ -32,7 +32,7 @@ CONFIG_JSON_SCHEMA = {
|
|||
'items': {'type': 'string'},
|
||||
},
|
||||
},
|
||||
'required': ['id', 'files'],
|
||||
'required': ['id'],
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -55,7 +55,7 @@ def try_regex(repo, hook, value, field_name):
|
|||
def validate_config_extra(config):
|
||||
for repo in config:
|
||||
for hook in repo['hooks']:
|
||||
try_regex(repo, hook['id'], hook['files'], 'files')
|
||||
try_regex(repo, hook['id'], hook.get('files', ''), 'files')
|
||||
try_regex(repo, hook['id'], hook['exclude'], 'exclude')
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue