Skip to content

refactor(fmt): reuse relative path resolver - #208

Merged
chenjiahan merged 1 commit into
mainfrom
chenjiahan/refactor-fmt-relative-path-resolver
Aug 6, 2026
Merged

refactor(fmt): reuse relative path resolver#208
chenjiahan merged 1 commit into
mainfrom
chenjiahan/refactor-fmt-relative-path-resolver

Conversation

@chenjiahan

Copy link
Copy Markdown
Member

Fixed-root relative path handling is duplicated across discovery, GitIgnoreMatcher, and formatter ignore matching. This PR extracts a shared resolver and reuses it in all three locations, while also reusing the resolved GitIgnore path for its root-boundary check.

On rsbuild, discovery path.relative calls drop from 12 to 2 for the default scan, from 11 to 1 for a positive glob, and from 12 to 2 for a negative glob. Focused tests cover root, descendant, and outside-root paths.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying rstack-cli with  Cloudflare Pages  Cloudflare Pages

Latest commit: 015bbd7
Status: ✅  Deploy successful!
Preview URL: https://50acb937.rstack-cli.pages.dev
Branch Preview URL: https://chenjiahan-refactor-fmt-rela.rstack-cli.pages.dev

View logs

@chenjiahan
chenjiahan merged commit 09e5b62 into main Aug 6, 2026
4 checks passed
@chenjiahan
chenjiahan deleted the chenjiahan/refactor-fmt-relative-path-resolver branch August 6, 2026 02:25
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