INNER CODE UNIT · Python
expected_indent
magicsword-io/LOLRMM · bin/fix_yaml_formatting.py:94
expected_indent = list_stack[-1][1]
fixed_lines.append(" " * expected_indent + stripped)
# If this line is a key (ends with :), track it for potential nested list
if ":" in stripped and not stripped.startswith("#"):
last_key_indent = expected_indent
else:
# Regular line, no adjustment needed
fixed_lines.append(line)
# Track if this is a key for potential nested list
if ":" in stripped and not stripped.startswith("#"):
last_key_indent = leading_spaces
else:
last_key_indent = None
return "\n".join(fixed_lines)
def fix_yaml_file(file_path):