INNER CODE UNIT · Python
expected_dash_indent
magicsword-io/LOLRMM · bin/fix_yaml_formatting.py:62
expected_dash_indent = last_key_indent + 4
fixed_lines.append(" " * expected_dash_indent + stripped)
list_stack.append((expected_dash_indent, expected_dash_indent + 2))
# Remember this adjustment for sibling dashes
dash_adjustments[leading_spaces] = expected_dash_indent
# If this dash has a key, track it for nested lists
if dash_has_key:
last_key_indent = expected_dash_indent + 2
else:
last_key_indent = None
else:
# Regular dash - keep as-is
fixed_lines.append(line)
# If this dash is at the same level as the top of stack, replace (sibling item)
# Otherwise push a new level (nested item)
if list_stack and leading_spaces == list_stack[-1][0]:
list_stack[-1] = (leading_spaces, leading_spaces + 2)
else: