INNER CODE UNIT · Python

leading_spaces

magicsword-io/LOLRMM · bin/fix_yaml_formatting.py:28

        leading_spaces = len(line) - len(stripped)

        # Pop from stack if we've decreased indentation below current level
        while list_stack and leading_spaces < list_stack[-1][0]:
            popped = list_stack.pop()
            # Clear adjustment tracking for this level
            if popped[0] in dash_adjustments:
                del dash_adjustments[popped[0]]

        # Check if this line starts with a dash (list item)
        if stripped.startswith("- "):
            # Check if this dash + key pattern (e.g., "- Domains:")
            # In this case, we need to track that nested lists should be adjusted
            dash_has_key = ":" in stripped[2:] and not stripped[2:].strip().startswith(
                "#"
            )

            # Check if we previously adjusted this indent level

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…