mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 18:11:48 +04:00
Autoupdate roundtrips. Resolves #210
This commit is contained in:
parent
da7e85c851
commit
de33fad483
11 changed files with 78 additions and 98 deletions
|
|
@ -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,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue