Repository navigation
fix(parser): count only top-level lists in list rules - #100
Merged
Merged
Conversation
Sub-lists nested under a list item were collected as separate lists, so a single list with a nested sub-list counted as two toward lists.min / lists.max. Skip lists whose parent is a list item. Fixes #91 Claude-Session: https://claude.ai/code/session_014K1p9VkeotiX1SR8pLWJSK
jackchuka
marked this pull request as ready for review
November 11, 2026 04:41
This was referenced Nov 11, 2026
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.
Summary
Sub-lists nested under a list item were collected as separate lists, so a single list with a nested sub-list counted as two toward
lists.min/lists.max. The parser now skips lists whose parent is a list item.Fixes #91
Behavior change
Nested lists no longer count toward any
listsrule. For example, a document that satisfiedtype: ordered, min: 1only through an ordered list nested inside a bullet list will now report a violation. Worth a note in the release.Test plan
TestListRuleIgnoresNestedLists(fails before the fix withfound 3, passes after)go test ./...andgo vet ./...pass