mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 16:24:40 +04:00
Add checking for manifest files regex.
This commit is contained in:
parent
bd1afceeaf
commit
bf912cfebb
4 changed files with 45 additions and 19 deletions
|
|
@ -4,12 +4,21 @@ import argparse
|
|||
import jsonschema
|
||||
import jsonschema.exceptions
|
||||
import os.path
|
||||
import re
|
||||
import yaml
|
||||
|
||||
from pre_commit.jsonschema_extensions import apply_defaults
|
||||
from pre_commit.util import entry
|
||||
|
||||
|
||||
def is_regex_valid(regex):
|
||||
try:
|
||||
re.compile(regex)
|
||||
return True
|
||||
except re.error:
|
||||
return False
|
||||
|
||||
|
||||
def get_validator(
|
||||
json_schema,
|
||||
exception_type,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue