mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-16 05:53:30 -06:00
Add checking for manifest files regex.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user