Autoupdate roundtrips. Resolves #210

This commit is contained in:
Anthony Sottile 2015-03-18 10:06:23 -07:00
parent da7e85c851
commit de33fad483
11 changed files with 78 additions and 98 deletions

View file

@ -12,6 +12,7 @@ import tarfile
import tempfile
import pkg_resources
import ruamel.yaml
from pre_commit import five
from pre_commit import parse_shebang
@ -213,3 +214,11 @@ def rmtree(path):
else:
raise
shutil.rmtree(path, ignore_errors=False, onerror=handle_remove_readonly)
yaml_load = functools.partial(
ruamel.yaml.load, Loader=ruamel.yaml.RoundTripLoader,
)
yaml_dump = functools.partial(
ruamel.yaml.dump, Dumper=ruamel.yaml.RoundTripDumper, encoding=None,
)