mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-15 05:20:20 -06:00
Add support for meta hooks
This commit is contained in:
@@ -98,6 +98,8 @@ def validate_manifest_main(argv=None):
|
||||
|
||||
|
||||
_LOCAL_SENTINEL = 'local'
|
||||
_META_SENTINEL = 'meta'
|
||||
|
||||
CONFIG_HOOK_DICT = schema.Map(
|
||||
'Hook', 'id',
|
||||
|
||||
@@ -121,7 +123,8 @@ CONFIG_REPO_DICT = schema.Map(
|
||||
|
||||
schema.Conditional(
|
||||
'sha', schema.check_string,
|
||||
condition_key='repo', condition_value=schema.Not(_LOCAL_SENTINEL),
|
||||
condition_key='repo',
|
||||
condition_value=schema.NotIn((_LOCAL_SENTINEL, _META_SENTINEL)),
|
||||
ensure_absent=True,
|
||||
),
|
||||
)
|
||||
@@ -138,6 +141,10 @@ def is_local_repo(repo_entry):
|
||||
return repo_entry['repo'] == _LOCAL_SENTINEL
|
||||
|
||||
|
||||
def is_meta_repo(repo_entry):
|
||||
return repo_entry['repo'] == _META_SENTINEL
|
||||
|
||||
|
||||
class InvalidConfigError(FatalError):
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user