mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
extend warning if globs are used instead of regex to local hooks
This commit is contained in:
parent
b1de3338ef
commit
a95f488e71
2 changed files with 48 additions and 1 deletions
|
|
@ -298,6 +298,14 @@ CONFIG_HOOK_DICT = cfgv.Map(
|
|||
OptionalSensibleRegexAtHook('files', cfgv.check_string),
|
||||
OptionalSensibleRegexAtHook('exclude', cfgv.check_string),
|
||||
)
|
||||
LOCAL_HOOK_DICT = cfgv.Map(
|
||||
'Hook', 'id',
|
||||
|
||||
*MANIFEST_HOOK_DICT.items,
|
||||
|
||||
OptionalSensibleRegexAtHook('files', cfgv.check_string),
|
||||
OptionalSensibleRegexAtHook('exclude', cfgv.check_string),
|
||||
)
|
||||
CONFIG_REPO_DICT = cfgv.Map(
|
||||
'Repository', 'repo',
|
||||
|
||||
|
|
@ -308,7 +316,7 @@ CONFIG_REPO_DICT = cfgv.Map(
|
|||
'repo', cfgv.NotIn(LOCAL, META),
|
||||
),
|
||||
cfgv.ConditionalRecurse(
|
||||
'hooks', cfgv.Array(MANIFEST_HOOK_DICT),
|
||||
'hooks', cfgv.Array(LOCAL_HOOK_DICT),
|
||||
'repo', LOCAL,
|
||||
),
|
||||
cfgv.ConditionalRecurse(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue