mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 10:01:46 +04:00
11 lines
292 B
Python
Executable file
11 lines
292 B
Python
Executable file
from ruamel import yaml
|
|
|
|
|
|
def yaml_dump(obj, **kwargs):
|
|
"Ensure order & comments preservation"
|
|
return yaml.dump(obj, Dumper=yaml.RoundTripDumper, **kwargs)
|
|
|
|
|
|
def yaml_load(content):
|
|
"Ensure order & comments preservation"
|
|
return yaml.load(content, Loader=yaml.RoundTripLoader)
|