You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add --include flag to modelfile generate (#473)
* feat: migrate PathFilter to doublestar, add include pattern support
- Migrate exclude matching from filepath.Match to doublestar.PathMatch
for consistency with pkg/backend/fetch.go
- Rename patterns field to excludePatterns, add includePatterns field
- Add MatchInclude() for matching include patterns against relative paths
- Add ShouldDescend() for directory descent via direct match or prefix match
- Add IncludePatterns field to GenerateConfig
- Validate patterns with doublestar.PathMatch on construction
- ** now supports recursive directory matching in exclude patterns
Signed-off-by: Zhao Chen <zhaochen.zju@gmail.com>
Signed-off-by: Zhao Chen <winters.zc@antgroup.com>
* feat: add --include flag to modelfile generate command
Bind --include flag with doublestar glob syntax. Help text documents
pattern syntax, matching base (relative to workspace root), and risk
warning for broad patterns.
Signed-off-by: Zhao Chen <zhaochen.zju@gmail.com>
Signed-off-by: Zhao Chen <winters.zc@antgroup.com>
* feat: integrate include pattern logic into generateByWorkspace
Update filter logic: directory exclude is absolute, isSkippable
entries can be rescued by include patterns via ShouldDescend and
MatchInclude, rescued files still go through exclude check.
Signed-off-by: Zhao Chen <zhaochen.zju@gmail.com>
Signed-off-by: Zhao Chen <winters.zc@antgroup.com>
* test: add integration tests for --include flag
Cover recursive hidden files, specific directory include, include
with exclude override, regression (no include), multiple patterns,
and selective directory entry.
Signed-off-by: Zhao Chen <zhaochen.zju@gmail.com>
Signed-off-by: Zhao Chen <winters.zc@antgroup.com>
* style: apply linter formatting fixes
Signed-off-by: Zhao Chen <zhaochen.zju@gmail.com>
Signed-off-by: Zhao Chen <winters.zc@antgroup.com>
* docs: add --include examples to modelfile generate help
Signed-off-by: Zhao Chen <zhaochen.zju@gmail.com>
Signed-off-by: Zhao Chen <winters.zc@antgroup.com>
---------
Signed-off-by: Zhao Chen <zhaochen.zju@gmail.com>
Signed-off-by: Zhao Chen <winters.zc@antgroup.com>
0 commit comments