Draft
Conversation
Collaborator
|
Commit: 0debcd3
19 interesting tests: 7 KNOWN, 5 SKIP, 5 RECOVERED, 2 flaky
Top 50 slowest tests (at least 2 minutes):
|
Separate concrete paths from wildcard patterns at the type level: - PathNode: for concrete paths without wildcards (used by Get, Set, Walk) - PatternNode: for patterns that may include wildcards (used by WalkType, Validate) - PathNodeBase: shared struct with common fields and methods Add cleaner parsing API: - ParsePath(s) -> (*PathNode, error) - ParsePattern(s) -> (*PatternNode, error) - MustParsePath(s), MustParsePattern(s) for tests Rename validation functions for consistency: - ValidatePath for PathNode - ValidatePattern for PatternNode Update HasChange to accept *PathNode with precalculated paths. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
26b99a6 to
4bf169b
Compare
Introduce PatternNode as a type definition of PathNode (type PatternNode PathNode) to distinguish between concrete paths (no wildcards) and patterns (with wildcards). - PatternNode methods delegate to PathNode via type casting - Add ParsePath() and ParsePattern() wrapper functions - Add PatternNode constructors (NewPatternDotStar, NewPatternBracketStar, etc.) - Remove NewDotStar/NewBracketStar from PathNode (wildcards only valid in patterns) - Unify path_test.go to test concrete paths with both APIs Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
4bf169b to
405f6a0
Compare
ValidatePath's internal validateNodeSlice already handles wildcards (BracketStar and DotStar), so no need for the slice copying loop. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Reimplement AsSlice() directly instead of delegating to PathNode - Restore the state machine transitions documentation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Rename Parse to parse (unexported) - Return (*PatternNode, error) instead of (*PathNode, *PatternNode, error) - ParsePattern returns directly, ParsePath casts to *PathNode - Restore state machine transitions documentation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Return error immediately when wildcard is encountered and wildcardAllowed is false, instead of tracking and checking at the end. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
PathNode should not have wildcard-related methods since wildcards can only exist in PatternNode. This enforces type safety - code working with PathNode cannot accidentally handle wildcards. - Remove DotStar() and BracketStar() from PathNode - Remove NewDotStar() and NewBracketStar() constructors - PatternNode now has its own DotStar/BracketStar implementations - validateNodeSlice now accepts []*PatternNode - ValidatePath delegates to ValidatePattern via cast Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The parse function now builds *PatternNode directly using PatternNode constructors, rather than building *PathNode and casting at the end. This is more consistent since wildcards only exist in PatternNode. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix parse function doc comment to match new signature - Restore comments in validateNodeSlice Co-Authored-By: Claude Opus 4.5 <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.
Changes
Separate concrete paths from wildcard patterns at the type level:
Add cleaner parsing API:
Rename validation functions for consistency:
Update HasChange to accept *PathNode with precalculated paths.
Why
Make it clear where we work with concrete path and where with pattern.