Moving from aspy.yaml to ruamel.yaml in order to preserve comments when using autoupdate - fixes #210

This commit is contained in:
Cimon Lucas (LCM) 2016-09-28 10:51:32 +02:00
parent bbf1f62ed6
commit ebaf7da989
6 changed files with 35 additions and 19 deletions

View file

@ -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))