Fix trailing whitespaces

kate you're better than this
This commit is contained in:
udf 2019-05-19 22:59:12 +02:00
parent 03e922ed86
commit b21f5ec104
Signed by untrusted user: kate
GPG Key ID: F17AECB58C3A3096
1 changed files with 4 additions and 3 deletions

View File

@ -45,11 +45,13 @@ def yaml_format(obj, indent=0):
if not formatted.strip():
continue
result.append(' ' * (indent if has_multiple_items else 1))
result.append(f'{k}: {formatted}')
result.append(f'{k}:')
if not formatted[0].isspace():
result.append(' ')
result.append(f'{formatted}')
result.append('\n')
result.pop()
indent -= 2
result.append(' ' * indent)
elif isinstance(obj, str):
# truncate long strings and display elipsis
result = repr(obj[:STR_LEN_MAX])
@ -75,7 +77,6 @@ def yaml_format(obj, indent=0):
result.append('\n')
result.pop()
indent -= 2
result.append(' ' * indent)
else:
return repr(obj)