mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-13 12:30:08 -06:00
Apply defaults to all of the configs. Much fewer .get()s
This commit is contained in:
@@ -4,6 +4,8 @@ import jsonschema.exceptions
|
||||
import os.path
|
||||
import yaml
|
||||
|
||||
from pre_commit.jsonschema_extensions import apply_defaults
|
||||
|
||||
|
||||
def get_validator(
|
||||
json_schema,
|
||||
@@ -39,6 +41,8 @@ def get_validator(
|
||||
'File {0} is not a valid file'.format(filename), e,
|
||||
)
|
||||
|
||||
obj = apply_defaults(obj, json_schema)
|
||||
|
||||
additional_validation_strategy(obj)
|
||||
|
||||
return obj
|
||||
|
||||
Reference in New Issue
Block a user