-
Notifications
You must be signed in to change notification settings - Fork 14
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
Replace globset with glob-match in watcher.rs and command.rs #99
base: main
Are you sure you want to change the base?
Conversation
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.
Nice submission. As the change were rather easy, do you see a way to test this end to end?
@@ -78,8 +79,8 @@ impl Actor for WatcherActor { | |||
#[rtype(result = "()")] | |||
pub struct WatchGlob { | |||
pub command: Addr<CommandActor>, | |||
pub on: GlobSet, | |||
pub off: GlobSet, | |||
pub on: Vec<String>, // Storing raw glob patterns instead of GlobSet |
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.
Will the comment still be useful for developer once the globset is removed? Same applies to a few comments in the PR.
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.
Certainly, an end-to-end test would provide greater confidence that the changes work seamlessly from a user's perspective. Here's a potential approach:
Setup: Prepare a dummy directory structure that mimics a typical use case for the application. This would include various files and directories with patterns we intend to test against.
Execution: Run our application on this directory structure. Use different glob patterns to match files and directories, making sure to test edge cases and any patterns that the old globset handled differently than glob-match.
Validation: Verify that the application's output (or behavior) is as expected. This means the right files are detected, the ignored patterns are truly ignored, etc.
Teardown: Clean up any resources or files created during the test.
I can go ahead and set up such a test. Would this approach meet your expectations? If there's a specific testing tool or framework you'd prefer to be used, please let me know!
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.
👍 that would work !
Fixes #24
Pull Request: Replace
globset
withglob-match
Overview:
This pull request proposes replacing the
globset
library with theglob-match
library in thewhiz
repository.Changes:
Files Modified:
watcher.rs
: Implementedglob-match
logic, replacing all instances ofglobset
. Ensured that the watcher functionality continues to operate as expected by testing for file changes.command.rs
: Removed unused imports related toglobset
and ensured that the integration withglob-match
is seamless. Also made necessary adjustments to data structures (e.g., replacingGlobSet
withVec<String>
for pattern storage).Package Changes:
glob-match
– An efficient and fast glob matching library.globset
– The previous glob matching library.Reason for Change:
The
glob-match
library provides an extremely efficient matching mechanism with zero allocations, no regex compilation, and a linear-time matching process. It's a lightweight and robust alternative toglobset
.Testing:
Would appreciate a review to ensure the changes are aligned with the repository's standards and objectives. Feedback is welcome.