Repository navigation
fix(rules): enforce lists.min_items during validation - #101
Merged
Merged
Conversation
min_items was documented and used for template generation, but the list rule never checked it. Record each list's top-level item count in the parser and report every list matching the rule's type that has fewer items than min_items, at the list's own position. Fixes #90 Claude-Session: https://claude.ai/code/session_014K1p9VkeotiX1SR8pLWJSK
jackchuka
marked this pull request as ready for review
November 11, 2026 04:44
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
min_itemswas documented in the README andschema.json, but only template generation read it; validation never checked it. The parser now records each list's top-level item count, and the list rule reports every list matching the rule'stypethat has fewer items thanmin_items.Fixes #90
Changes
parser.ListgainsItemCount(direct items only; nested sub-list items are not counted)internal/rules/list.go: per-listmin_itemscheck, reported at the list's own line/column; type filter extracted intolistMatchesTypetyperespectedBehavior change
Schemas that set
min_itemswill now report lists that are too short. Worth a note in the release.Test plan
go test ./...andgo vet ./...passexamples/*and the README self-check still pass