INNER CODE UNIT · Python
leading_spaces
magicsword-io/LOLRMM · bin/fix_yaml_formatting.py:77
if list_stack and leading_spaces == list_stack[-1][0]:
list_stack[-1] = (leading_spaces, leading_spaces + 2)
else:
list_stack.append((leading_spaces, leading_spaces + 2))
# If this dash has a key, track it for nested lists
if dash_has_key:
last_key_indent = leading_spaces + 2 # Key is at dash + 2
else:
last_key_indent = None
# Check if we're in a list and this line should be a continuation
elif (
list_stack
and leading_spaces == list_stack[-1][0]
and not stripped.startswith("- ")
):
# This line is at the dash indent level but isn't a new list item
# It should be a continuation - indent it to expected_continuation_indent
expected_indent = list_stack[-1][1]