Skip to content

feat(file): Add Find method for recursive file discovery with ** patterns - #249

Merged
David-Noble-at-work merged 1 commit into
developfrom
feat/file-find-method
Mar 18, 2026
Merged

David-Noble-at-work merged 1 commit into
developfrom
feat/file-find-method

Conversation

@David-Noble-at-work

Copy link
Copy Markdown
Contributor

Summary

  • file.Find — new method for recursive file discovery with ** glob patterns, honoring gitignore
  • Mkdir zero-mode guard — Mkdir(path) without mode now defaults to 0755 (was passing 0, causing permission denied)
  • Issue refactor(file): Redesign WalkTree for Starlark consumption #248 — logged WalkTree Reducer redesign for Starlark consumption

Unblocks noblefactor-ops Phase 2: .star scripts can use file.find("**/*.go") instead of the hand-coded recursive glob.

Test plan

  • make test passes — all packages green
  • golangci-lint run ./pkg/op/provider/file/... — 0 issues
  • Starlark integration tests: find("**/*.go") finds 2 files, find("**/*.md") finds 1, find("**/*.*") finds 3
  • make generate produces correct params with Find entry

…erns

Add file.Find(pattern, honorGitignore?) that walks the directory tree and
matches entries against glob patterns with ** support. Unlike file.Glob
(which delegates to filepath.Glob and has no ** support), Find handles
recursive patterns like "**/*.go" and "src/**/*.yaml".

- Reuses applyGitignore and newTrackerIfEnabled helpers from WalkTree
- Pattern matching via matchDoublestar with single and multi-segment **
- Add Mkdir zero-mode guard (defaults to 0755 when mode=0)
- Integration tests: find **/*.go, **/*.md, **/*.* with nested dirs
- Logged issue #248 for WalkTree Reducer redesign
@David-Noble-at-work
David-Noble-at-work merged commit 2ef6025 into develop Mar 18, 2026
2 checks passed
@David-Noble-at-work
David-Noble-at-work deleted the feat/file-find-method branch March 18, 2026 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant