Settings: disable automatic yaml line breaks (#3096)

* Settings: disable automatic yaml line breaks

* Tests: add settings formatting checks

* Tests: fix typing in test_host_yaml
This commit is contained in:
black-sliver
2024-04-18 19:13:43 +02:00
committed by GitHub
parent f89cee4b15
commit 6087ec539b
2 changed files with 53 additions and 3 deletions

View File

@@ -200,7 +200,7 @@ class Group:
def _dump_value(cls, value: Any, f: TextIO, indent: str) -> None:
"""Write a single yaml line to f"""
from Utils import dump, Dumper as BaseDumper
yaml_line: str = dump(value, Dumper=cast(BaseDumper, cls._dumper))
yaml_line: str = dump(value, Dumper=cast(BaseDumper, cls._dumper), width=2**31-1)
assert yaml_line.count("\n") == 1, f"Unexpected input for yaml dumper: {value}"
f.write(f"{indent}{yaml_line}")