-
-
Notifications
You must be signed in to change notification settings - Fork 475
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
feat(search): add matches number to summary #3747
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 work! Just two minor suggestions. It looks like there's still a lint issue and snapshots need to be updated.
@@ -27,6 +27,8 @@ pub(crate) enum FileStatus { | |||
Unchanged, | |||
/// While handling the file, something happened | |||
Message(Message), | |||
/// A match was found while searching a file | |||
Search(Message), |
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.
Maybe Match
or SearchResult
is a better name? It doesn't seem to be used generically for messages from the search
command.
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.
SearchResult
sounds better, thank you 🙏
@@ -691,6 +700,11 @@ fn handle_file(ctx: &TraversalOptions, path: &BiomePath) { | |||
Ok(Ok(FileStatus::Unchanged)) => { | |||
ctx.increment_unchanged(); | |||
} | |||
Ok(Ok(FileStatus::Search(msg))) => { | |||
ctx.increment_changed(path); |
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.
What purpose is there for bumping changed
? It feels semantically off, and I don't see why it's necessary...
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.
My bad, I meant to increment the unchanged files, aka when a match is found in a file it will still report that file as "searched"
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.
👍 Just a lint still.
Summary
This PR aims to provide a summary of the search command, citing how many matches were found during the operation.
Test Plan
No tests have been provided.