feat: implement MD007 ul-indent rule with perfect parity (#59)#59
Merged
Conversation
Implements MD007 (ul-indent) rule for unordered list indentation consistency. This rule ensures list items are indented by the configured number of spaces with support for complex nesting scenarios and mixed list types. ## Features - **Three configuration parameters**: - `indent`: Spaces per nesting level (default: 2) - `start_indent`: Spaces for first level when start_indented=true (default: 2) - `start_indented`: Whether to indent first level (default: false) - **Smart list detection**: Only checks unordered lists, ignores ordered lists - **Proper nesting handling**: Correctly calculates indentation based on tree structure - **Mixed list support**: Ignores unordered lists nested within ordered lists ## Implementation - Uses Token-based rule type for optimal performance with AST caching - Comprehensive nesting level calculation with proper parent list validation - Single-pass analysis with efficient tree traversal - Perfect parity with original markdownlint validated through testing ## Testing - 14 comprehensive unit tests covering all configuration combinations - 2 TOML configuration parsing tests - 3 test sample files following project conventions - Edge case coverage: empty documents, single items, nested structures - Parity validation against original markdownlint ## Documentation - Complete rule documentation with examples and configuration details - Updated README.md with rule status and configuration - Comprehensive test samples demonstrating valid/invalid patterns 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements MD007 (ul-indent) rule for unordered list indentation consistency. This rule ensures list items are indented by the configured number of spaces with support for complex nesting scenarios and mixed list types.
Features
Three configuration parameters:
indent: Spaces per nesting level (default: 2)start_indent: Spaces for first level when start_indented=true (default: 2)start_indented: Whether to indent first level (default: false)Smart list detection: Only checks unordered lists, ignores ordered lists
Proper nesting handling: Correctly calculates indentation based on tree structure
Mixed list support: Ignores unordered lists nested within ordered lists
Implementation
Testing
Documentation
🤖 Generated with Claude Code