-
Notifications
You must be signed in to change notification settings - Fork 775
refactor: replace minimatch with picomatch #1847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Summary of ChangesHello @hyperz111, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refactors the project's dependency for glob pattern matching, transitioning from Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request replaces minimatch with picomatch for better performance. While this is a beneficial change, the current implementation has a critical issue. picomatch is not a direct drop-in replacement for minimatch as their API signatures differ. The arguments in the picomatch calls are in the wrong order, which will break the file exclusion logic in both the file list and the search functionality. I've added comments with suggestions to correct the argument order.
Greptile OverviewGreptile SummaryThis PR replaces Critical Issues:
Required Fix: Confidence Score: 0/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant FileList as fileList.js
participant Worker as searchInFiles/worker.js
participant Matcher as Pattern Matcher
Note over User,Matcher: File Exclusion Flow (fileList.js)
User->>FileList: Load directory with exclusion patterns
FileList->>FileList: createChildTree(parent, item, root)
FileList->>Matcher: picomatch(pattern, options)
Matcher-->>FileList: Returns matcher function
FileList->>Matcher: matcher(file.path)
Matcher-->>FileList: Returns boolean (match result)
alt File matches exclusion
FileList->>FileList: Skip file/folder
else File does not match
FileList->>FileList: Include file/folder
end
Note over User,Matcher: Search in Files Flow (worker.js)
User->>Worker: Search with include/exclude patterns
Worker->>Worker: Skip.test(file)
Worker->>Matcher: picomatch(pattern, options)
Matcher-->>Worker: Returns matcher function
Worker->>Matcher: matcher(file.path)
Matcher-->>Worker: Returns boolean (match result)
alt File should be skipped
Worker->>Worker: Skip search
else File should be searched
Worker->>Worker: Process file for search
end
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 files reviewed, 2 comments
|
@UnschooledGamer, what about this? |
I'm done with the day. By time I hit bed. @bajrangCoder will be here. Once he checks. We'll merge or reject it depends. |
picomatchis faster thanminimatchand maybe can be it drop-in replacement. You can check this comparisons.