feat(fmt): add file path discovery - #117
Conversation
Deploying rstack-cli with
|
| Latest commit: |
44cc5b2
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://bc3ab98a.rstack-cli.pages.dev |
| Branch Preview URL: | https://chenjiahan-feat-fmt-file-dis.rstack-cli.pages.dev |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8d1404bf79
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Warning Review limit reached
Next review available in: 52 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdded 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/rstack/src/fmt/discoverPaths.ts (1)
226-244: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winNegative globs don't prune traversal early.
Negative-glob filtering only happens after
candidatesis fully populated (lines 231-244). A pattern like'!dist/**'still fully traverses thedistsubtree viatiny-readdirbefore every discovered file gets discarded. For large excluded subtrees (build output, coverage reports) not caught byalwaysIgnoredNames, this wastes I/O.Consider also checking
negativeGlobMatchersinside theignorecallback increateTraversalOptionsso whole excluded directories get pruned during traversal, not just filtered afterward.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/rstack/src/fmt/discoverPaths.ts` around lines 226 - 244, Update createTraversalOptions so its ignore callback evaluates negativeGlobMatchers against each traversed path and prunes matching directories during traversal, including patterns such as !dist/**. Retain the existing post-traversal filtering in the candidates loop to exclude matching files and preserve current binary and path handling behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/rstack/src/fmt/discoverPaths.ts`:
- Around line 70-73: Add the technical terms “dirent” and “dirents” to the
project CSpell dictionary (or annotate the onDirents usage in
packages/rstack/src/fmt/discoverPaths.ts, lines 70-73) and add “extglob” to the
dictionary (or annotate the extglob test pattern in
packages/rstack/tests/fmt/discoverPaths.test.ts, lines 63-77) so both CSpell
failures are resolved.
---
Nitpick comments:
In `@packages/rstack/src/fmt/discoverPaths.ts`:
- Around line 226-244: Update createTraversalOptions so its ignore callback
evaluates negativeGlobMatchers against each traversed path and prunes matching
directories during traversal, including patterns such as !dist/**. Retain the
existing post-traversal filtering in the candidates loop to exclude matching
files and preserve current binary and path handling behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: d6b2a0cf-92f2-4244-b6f6-5bc5925cb2e6
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (5)
packages/rstack/THIRD_PARTY_NOTICES.mdpackages/rstack/package.jsonpackages/rstack/src/fmt/discoverPaths.tspackages/rstack/tests/fmt/discoverPaths.test.tspnpm-workspace.yaml
Summary
This PR adds an internal path-discovery primitive for the formatter so later
rs fmtwork can expand files, directories, and globs without depending on Prettier configuration. It combines overlapping traversal roots, preserves brace, extglob, dotfile, and negative-glob behavior through micromatch, and skips VCS directories,node_modules, symlinks, and binary paths. It also bundlestiny-readdirandis-binary-pathwith their required notices.