perf(fmt): add native config matcher batch APIs - #395
Conversation
Deploying rstack-cli with
|
| Latest commit: |
797b176
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://7e2c3260.rstack-cli.pages.dev |
| Branch Preview URL: | https://chenjiahan-feat-native-confi.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: 797b17652a
ℹ️ 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".
|
|
||
| /// Matches children with nonzero candidate flags and returns one byte per input name. | ||
| #[napi] | ||
| pub fn is_ignored_batch( |
There was a problem hiding this comment.
Wire the batch APIs into formatter discovery
When rs fmt traverses directories with config.ignorePatterns or --ignore-path, createSourceMatcher still exposes only a per-path predicate backed by matcher.isIgnored, and createTraversalOptions.ignore invokes that predicate separately for every entry. The existing batched traversal path calls GitIgnoreMatcher, not these new IgnoreMatcher methods, so repository-wide production code never reaches this API and the claimed reduction in JavaScript-to-Rust calls does not occur; expose and consume the new batch operations from formatter discovery.
Useful? React with 👍 / 👎.
This PR adds batch APIs to the private native config ignore matcher so formatter discovery can evaluate sibling paths with fewer JavaScript-to-Rust calls. It supports byte-array batches, 32-entry bit-mask batches, and a single-child helper while preserving independent ignore-source semantics and candidate short-circuiting. Sparse masks visit only the remaining set bits, with Rust and native integration coverage for root handling, high-bit masks, and invalid inputs.