feat(structure): allow deep nesting at selected paths#82
Open
choplin wants to merge 1 commit into
Open
Conversation
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.
What this PR does
Some valid skill packages intentionally group opt-in asset bundles under paths
such as
assets/components/<name>/. Flattening those bundles only to satisfy thegeneric deep-nesting warning makes the package harder to maintain.
This PR adds
--allow-nested-pathstovalidate structureandcheck. Theoption suppresses only deep-nesting warnings within explicitly selected,
skill-relative subtrees. Other structure, frontmatter, orphan, token, Markdown,
and link checks continue unchanged.
Paths are normalized across operating systems, matched on path boundaries, and
rejected when absolute or when they escape the skill root. A visible info result
is emitted whenever an exception is applied.
The main implementation lives in:
structure/paths.go— portable relative-path validation and subtree matchingstructure/checks.go— scoped deep-nesting exception handlingcmd/{validate_structure,check}.go— matching CLI flags and option propagationstructure/*_test.go,cmd/exitcode_integration_test.go, andtestdata/nested-paths-skill/— boundary, CLI, and output-format coverageHow to test
go test -race ./... -count=1 golangci-lint runThe integration tests cover both commands, comma-separated paths, Windows
separators, invalid absolute/traversal paths, similar-prefix siblings, and text,
JSON, and Markdown output.
Checklist
go test -race ./... -count=1)golangci-lint run)