Skip to content

Conversation

@JounQin
Copy link
Member

@JounQin JounQin commented Jun 2, 2025

fix #100
close #151


Important

Introduce asynchronous and batch processing for file staging with improved error handling and a new callback for custom actions.

  • New Features:
    • Asynchronous and batch processing for file staging in index.ts, scms/git.ts, and scms/hg.ts.
    • Added onStageFiles callback in PrettyQuickOptions in types.ts for custom actions during staging.
  • Bug Fixes:
    • Improved error messages for staging failures in cli.mts.
  • Refactor:
    • Made file operations asynchronous in createIgnorer.ts and processFiles.ts.
  • Misc:
    • Minor formatting changes in createMatcher.ts.

This description was created by Ellipsis for f3ed526. You can customize this summary. It will automatically update as commits are pushed.


Summary by CodeRabbit

  • New Features

    • Improved file staging with asynchronous and batch processing, allowing multiple files to be staged at once for both Git and Mercurial.
    • Added support for an optional callback when files are staged, enabling custom actions or notifications.
  • Bug Fixes

    • Enhanced error handling with clearer messages if file staging fails, guiding users to resolve issues before committing.
  • Refactor

    • Updated file reading and writing operations to be fully asynchronous for better performance and reliability.

@JounQin JounQin requested a review from Copilot June 2, 2025 02:24
@JounQin JounQin self-assigned this Jun 2, 2025
@JounQin JounQin added enhancement New feature or request BREAKING labels Jun 2, 2025
@changeset-bot
Copy link

changeset-bot bot commented Jun 2, 2025

🦋 Changeset detected

Latest commit: f3ed526

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
pretty-quick Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link

coderabbitai bot commented Jun 2, 2025

Walkthrough

The changes refactor the codebase to use asynchronous file operations and batch staging of files. New batch stageFiles functions replace single-file staging for both Git and Hg. The main processing and ignorer creation are now async, and batch staging is performed after all file writes. An optional callback for staged files is also introduced.

Changes

File(s) Change Summary
.changeset/great-panthers-shout.md Added changeset declaring a major version update for async and batch stage commands.
src/cli.mts Added onStageFiles callback, error handling for batch staging, and changed main invocation to async.
src/createIgnorer.ts Refactored to async; uses fs/promises and async file checks/reads.
src/createMatcher.ts Removed extraneous blank line; no functional change.
src/index.ts Refactored to async ignorer creation; collects files to stage and batches staging after processing.
src/processFiles.ts Refactored to use async file I/O and parallel file processing with Promise.all.
src/scms/git.ts, src/scms/hg.ts Replaced single-file staging with async batch stageFiles (chunks of 100 files per command).
src/types.ts Added optional onStageFiles callback to PrettyQuickOptions interface.

Sequence Diagram(s)

sequenceDiagram
    participant CLI
    participant prettyQuick
    participant Ignorer
    participant FileProcessor
    participant SCM

    CLI->>prettyQuick: Call with options (onStageFiles)
    prettyQuick->>Ignorer: await createIgnorer()
    prettyQuick->>FileProcessor: await processFiles()
    FileProcessor->>FileProcessor: Process files asynchronously
    FileProcessor-->>prettyQuick: Return files to stage
    prettyQuick->>CLI: Call onStageFiles(files)
    prettyQuick->>SCM: await stageFiles(files)
    SCM->>SCM: Batch files, run add in chunks
    SCM-->>prettyQuick: Staging done
    prettyQuick-->>CLI: Return result
Loading

Assessment against linked issues

Objective Addressed Explanation
Use async approach for file read/write and processing (#100, #151)
Implement batch staging commands for Git and Hg (#151)
Add optional callback for staged files and handle staging errors (#151)
Refactor ignorer creation and processing to be asynchronous (#151)
End-to-end tests for Hg, performance stats, and batch staging tests (#151) These are non-coding/testing tasks not addressed in the code changes.

Poem

In the warren of code, async hops in stride,
Batch staging commands, now files can hide.
No more one-by-one, the rabbits all cheer,
Prettier and quicker, the finish line near!
🐇✨

"Stage in a bundle," the bunnies all say,
"Our commits are much faster—hip hip hooray!"

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/createIgnorer.ts

Oops! Something went wrong! :(

ESLint: 9.28.0

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@1stg/eslint-config' imported from /eslint.config.mjs
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:799:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:723:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:706:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:307:38)
at #link (node:internal/modules/esm/module_job:170:49)

src/index.ts

Oops! Something went wrong! :(

ESLint: 9.28.0

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@1stg/eslint-config' imported from /eslint.config.mjs
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:799:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:723:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:706:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:307:38)
at #link (node:internal/modules/esm/module_job:170:49)

src/processFiles.ts

Oops! Something went wrong! :(

ESLint: 9.28.0

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@1stg/eslint-config' imported from /eslint.config.mjs
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:799:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:723:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:706:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:307:38)
at #link (node:internal/modules/esm/module_job:170:49)

  • 3 others

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 87ebabb and f3ed526.

📒 Files selected for processing (9)
  • .changeset/great-panthers-shout.md (1 hunks)
  • src/cli.mts (2 hunks)
  • src/createIgnorer.ts (1 hunks)
  • src/createMatcher.ts (0 hunks)
  • src/index.ts (5 hunks)
  • src/processFiles.ts (2 hunks)
  • src/scms/git.ts (1 hunks)
  • src/scms/hg.ts (1 hunks)
  • src/types.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • src/createMatcher.ts
🚧 Files skipped from review as they are similar to previous changes (8)
  • .changeset/great-panthers-shout.md
  • src/types.ts
  • src/cli.mts
  • src/processFiles.ts
  • src/scms/hg.ts
  • src/index.ts
  • src/createIgnorer.ts
  • src/scms/git.ts
✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors file staging commands to use asynchronous and batched processing for both Mercurial and Git, replacing synchronous and single-file staging functions with new, more scalable alternatives.

  • Introduce a new onStageFiles hook in PrettyQuickOptions.
  • Replace stageFile with asynchronous, batched stageFiles functions in both hg and git modules.
  • Update file operations to use fs/promises and adjust CLI and index integration accordingly.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/types.ts Added the onStageFiles hook to the PrettyQuickOptions interface.
src/scms/hg.ts Removed stageFile and introduced batched async stageFiles implementation.
src/scms/git.ts Removed stageFile and introduced batched async stageFiles implementation.
src/processFiles.ts Refactored to use async file operations with fs/promises.
src/index.ts Integrated the onStageFiles hook and updated staging logic in the main flow.
src/createMatcher.ts Removed an extraneous blank line for clarity.
src/createIgnorer.ts Updated to use fs/promises with asynchronous file reading and tryFile check.
src/cli.mts Added logging for onStageFiles and updated the invocation style for main.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jun 2, 2025

Open in StackBlitz

npm i https://pkg.pr.new/pretty-quick@208

commit: f3ed526

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jun 2, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@codecov-commenter
Copy link

codecov-commenter commented Jun 2, 2025

Codecov Report

Attention: Patch coverage is 74.50980% with 13 lines in your changes missing coverage. Please review.

Project coverage is 87.11%. Comparing base (fe30f32) to head (f3ed526).

Files with missing lines Patch % Lines
src/scms/hg.ts 10.00% 9 Missing ⚠️
src/processFiles.ts 80.00% 3 Missing ⚠️
src/index.ts 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #208      +/-   ##
==========================================
- Coverage   90.58%   87.11%   -3.48%     
==========================================
  Files           9        9              
  Lines         170      194      +24     
  Branches       41       44       +3     
==========================================
+ Hits          154      169      +15     
- Misses         16       25       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Changes requested ❌

Reviewed everything up to f4f656a in 1 minute and 22 seconds. Click for details.
  • Reviewed 277 lines of code in 8 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. src/createIgnorer.ts:15
  • Draft comment:
    Consider adding error handling around the file read operation. If readFile fails (e.g. due to permission issues), it might cause an unhandled rejection.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50% None
2. src/processFiles.ts:21
  • Draft comment:
    Using Promise.all to process all files concurrently can be a performance risk in very large repositories. Consider throttling concurrency to avoid overwhelming system resources.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50% None
3. src/scms/git.ts:88
  • Draft comment:
    The batch staging logic uses a fixed chunk size of 100 files. It might be beneficial to make this value configurable in case repositories have significantly more or fewer files.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50% None
4. src/index.ts:112
  • Draft comment:
    In the staging step, if an error occurs while staging files, only a generic 'STAGE_FAILED' flag is added. Consider logging the caught error to aid debugging.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50% None

Workflow ID: wflow_6oydEOglWmNiu2Nu

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

src/cli.mts Outdated
console.log(`🔍 Examining ${picocolors.bold(file)}.`)
},

onStageFiles() {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The onStageFiles callback is defined without any parameters, but later it’s invoked with an array of files. For consistency with the expected signature (onStageFiles(files: string[])), update the callback to accept a parameter.

Suggested change
onStageFiles() {
onStageFiles(files) {

Co-authored-by: Cameron Hessler <cameronhessler123@gmail.com>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
src/cli.mts (1)

54-56: ⚠️ Potential issue

Fix callback parameter to match interface signature.

The onStageFiles callback is defined without parameters, but according to the interface in src/types.ts, it should accept a files: string[] parameter.

Apply this diff to fix the parameter mismatch:

-    onStageFiles() {
+    onStageFiles(files) {
       console.log(`🏗️  Staging changed files.`)
     },
🧹 Nitpick comments (1)
src/index.ts (1)

110-117: Well-implemented batch staging with proper error handling.

The batch staging implementation correctly:

  • Invokes the callback before staging
  • Handles staging failures gracefully
  • Uses try-catch to capture any staging errors

Consider the performance implications for very large changesets. The current implementation stages all files at once, but for repositories with hundreds of changed files, you might want to consider chunking the staging operations:

  if (filesToStage.length > 0) {
    try {
      await onStageFiles?.(filesToStage)
-     await scm.stageFiles(directory, filesToStage)
+     // Stage in chunks of 100 to avoid command line length limits
+     const CHUNK_SIZE = 100
+     for (let i = 0; i < filesToStage.length; i += CHUNK_SIZE) {
+       const chunk = filesToStage.slice(i, i + CHUNK_SIZE)
+       await scm.stageFiles(directory, chunk)
+     }
    } catch {
      failReasons.add('STAGE_FAILED')
    }
  }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fe30f32 and 87ebabb.

📒 Files selected for processing (9)
  • .changeset/great-panthers-shout.md (1 hunks)
  • src/cli.mts (2 hunks)
  • src/createIgnorer.ts (1 hunks)
  • src/createMatcher.ts (0 hunks)
  • src/index.ts (5 hunks)
  • src/processFiles.ts (2 hunks)
  • src/scms/git.ts (1 hunks)
  • src/scms/hg.ts (1 hunks)
  • src/types.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • src/createMatcher.ts
🧰 Additional context used
🧬 Code Graph Analysis (3)
src/scms/hg.ts (1)
src/scms/git.ts (1)
  • stageFiles (87-104)
src/scms/git.ts (1)
src/scms/hg.ts (3)
  • getUnstagedChangedFiles (56-56)
  • getChangedFiles (39-54)
  • stageFiles (58-75)
src/index.ts (1)
src/createIgnorer.ts (1)
  • createIgnorer (9-22)
🔇 Additional comments (13)
src/types.ts (1)

19-19: LGTM! Well-designed callback interface.

The new onStageFiles callback method follows the established pattern of other callbacks in the interface and correctly supports both synchronous and asynchronous implementations.

.changeset/great-panthers-shout.md (1)

1-6: Appropriate major version bump for breaking changes.

The changeset correctly identifies this as a major version update, which is appropriate given the introduction of async operations and batch staging that could affect existing integrations.

src/cli.mts (2)

78-82: Good error handling for staging failures.

The addition of STAGE_FAILED error handling provides useful feedback to users when batch staging fails, advising them to manually stage Prettier changes.


88-88: Proper async function invocation.

Using void main() is the correct way to invoke a top-level async function, ensuring any unhandled promise rejections are properly handled.

src/index.ts (3)

28-28: Correctly added callback parameter.

The onStageFiles parameter is properly added to the function signature, matching the interface definition in src/types.ts.


43-47: Consistent async implementation.

The createIgnorer calls are correctly updated to use await, which is consistent with the function being made async as shown in the relevant code snippets from src/createIgnorer.ts.


83-94: Efficient batch collection approach.

The change from immediate individual staging to collecting files in filesToStage array is a good optimization that will reduce the number of SCM operations.

src/scms/hg.ts (1)

58-75: LGTM! Well-implemented batch staging with proper chunking.

The stageFiles function correctly implements batching to avoid command line argument limits. The logic is consistent with the Git implementation and handles the chunking efficiently.

One consideration: if any batch fails, the entire operation will fail due to the await in the loop. This provides fail-fast behavior which is likely desired for staging operations.

src/createIgnorer.ts (2)

9-22: LGTM! Clean async conversion of the ignore file reader.

The conversion to async is well-executed. The function signature and logic remain intact while properly adopting async/await patterns for file operations.


15-15:

Details

❓ Verification inconclusive

Verify that tryFile behaves equivalently to fs.existsSync for this use case.

The replacement of fs.existsSync(file) with tryFile(file) needs verification. While both check for file existence, they may have different behaviors or return types that could affect the conditional logic.


🏁 Script executed:

#!/bin/bash
# Description: Verify the behavior and signature of tryFile function from @pkgr/core
# Expected: Documentation or source code showing tryFile behavior matches fs.existsSync

# Check the tryFile function documentation/source
rg -A 10 -B 5 "export.*tryFile" 

# Also check for any existing usage patterns of tryFile in the codebase
rg "tryFile" -A 3 -B 3

Length of output: 755


🏁 Script executed:

#!/bin/bash
set -e

# Step 1: Retrieve the dist tarball URL for @pkgr/core
TARBALL_URL=$(npm view @pkgr/core dist.tarball)
echo "Using tarball: $TARBALL_URL"

# Step 2: List files in the tarball to locate source of tryFile
echo "---- Listing matching paths ----"
curl -sL "$TARBALL_URL" | tar -tz | grep -i 'tryFile'

# Step 3: Extract and display the implementation files for tryFile
echo "---- tryFile source (src) ----"
curl -sL "$TARBALL_URL" | tar -xzO package/src/tryFile.* 2>/dev/null || echo "No src/tryFile.* found"

echo
echo "---- tryFile source (lib/dist) ----"
curl -sL "$TARBALL_URL" | tar -xzO package/lib/tryFile.* 2>/dev/null || curl -sL "$TARBALL_URL" | tar -xzO package/dist/index.js | sed -n '1,200p'

# If the above fails, you can fall back on inspecting the full index.js or main entry point

Length of output: 431


Confirm tryFile matches fs.existsSync semantics

Our automated inspection of the published @pkgr/core package didn’t surface the tryFile implementation, so it’s unclear whether it synchronously returns a boolean exactly like fs.existsSync. Please verify that:

  • tryFile(filePath) returns true if the file exists and false otherwise (no thrown errors).
  • It’s a synchronous check (not an async function or returning a Promise).
  • There are no side-effects beyond existence checking.

If any of these differ, adjust the code or replace tryFile with a suitable equivalent.

src/processFiles.ts (1)

37-37: Correct use of return instead of continue in the mapped function.

The change from continue to return is correct for the new Promise.all(map()) structure, as continue is not valid within a mapped function.

src/scms/git.ts (2)

84-85: Clean simplification of getUnstagedChangedFiles.

Converting to an arrow function with implicit return is a nice simplification that maintains the same functionality while reducing code verbosity.


87-104: Excellent consistency with the Hg implementation.

The stageFiles function implementation is identical to the one in src/scms/hg.ts, which ensures consistent behavior across different SCM systems. The batching logic properly handles command line argument limits and provides good error propagation.

@JounQin JounQin force-pushed the feat/async_batch branch from 87ebabb to f3ed526 Compare June 2, 2025 02:31
Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed f3ed526 in 47 seconds. Click for details.
  • Reviewed 288 lines of code in 9 files
  • Skipped 0 files when reviewing.
  • Skipped posting 8 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. .changeset/great-panthers-shout.md:1
  • Draft comment:
    Changeset formatting looks good. Ensure the version bump and changelog notes align with the project guidelines.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
2. src/cli.mts:54
  • Draft comment:
    The new onStageFiles callback is a nice addition for logging batch staging operations. Consider enhancing error logging (perhaps by exposing caught error details) to aid debugging if staging fails.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
3. src/createIgnorer.ts:15
  • Draft comment:
    Switching to async file system operations improves performance. Verify that every consumer of createIgnorer now awaits its result.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
4. src/index.ts:110
  • Draft comment:
    Batch staging is implemented correctly by collecting files and handling them in groups. It might help to log the error details in the catch block when staging fails, to ease troubleshooting.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
5. src/processFiles.ts:21
  • Draft comment:
    Refactoring file processing with Promise.all and async/await is a good performance improvement. Confirm that any individual file errors are managed as intended.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
6. src/scms/git.ts:88
  • Draft comment:
    Batch staging in git.ts is correctly splitting files into chunks of 100. Consider if additional logging or error handling per batch might be beneficial for debugging large commits.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
7. src/scms/hg.ts:58
  • Draft comment:
    The batched staging logic for Mercurial mirrors that of Git. It works well, though you might consider a guard check for empty batches to be extra safe.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
8. src/types.ts:19
  • Draft comment:
    The PrettyQuickOptions interface now includes onStageFiles. Ensure that downstream implementations correctly handle this new callback.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None

Workflow ID: wflow_ULiCK80JFFDtN8P5

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@JounQin JounQin merged commit 3ae6b72 into master Jun 2, 2025
23 checks passed
@JounQin JounQin deleted the feat/async_batch branch June 2, 2025 02:35
@JounQin JounQin mentioned this pull request Jun 2, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BREAKING enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use async approach

3 participants