mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 18:11:48 +04:00
Moving from aspy.yaml to ruamel.yaml in order to preserve comments when using autoupdate - fixes #210
This commit is contained in:
parent
bbf1f62ed6
commit
ebaf7da989
6 changed files with 35 additions and 19 deletions
|
|
@ -9,9 +9,9 @@ import sys
|
|||
import jsonschema
|
||||
import jsonschema.exceptions
|
||||
import pkg_resources
|
||||
import yaml
|
||||
|
||||
from pre_commit.jsonschema_extensions import apply_defaults
|
||||
from pre_commit.yaml import yaml_load
|
||||
|
||||
|
||||
def is_regex_valid(regex):
|
||||
|
|
@ -36,7 +36,7 @@ def get_validator(
|
|||
the object read from the file. The function should either raise
|
||||
exception_type on failure.
|
||||
"""
|
||||
def validate(filename, load_strategy=yaml.load):
|
||||
def validate(filename, load_strategy=yaml_load):
|
||||
if not os.path.exists(filename):
|
||||
raise exception_type('File {} does not exist'.format(filename))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue