Add karva snapshot delete command and fix snapshot path filtering#455
Merged
MatthewMckee4 merged 1 commit intomainfrom Feb 10, 2026
Merged
Add karva snapshot delete command and fix snapshot path filtering#455MatthewMckee4 merged 1 commit intomainfrom
karva snapshot delete command and fix snapshot path filtering#455MatthewMckee4 merged 1 commit intomainfrom
Conversation
Add a new `karva snapshot delete` subcommand that deletes all snapshot files (.snap and .snap.new) with optional path filtering and --dry-run. Fix path filtering across all snapshot commands (accept, reject, pending, review, prune, delete) by replacing unreliable `string.contains()` substring matching with absolute-path prefix matching. Filter paths are now resolved to absolute paths via `resolve_filter_paths()` and compared using `str::starts_with()`, preventing false matches on partial path components.
5c6fa9d to
bda943d
Compare
Merging this PR will not alter performance
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
karva snapshot deletesubcommand that deletes all snapshot files (.snapand.snap.new) with optional path filtering and--dry-runsupportstring.contains()substring matching with absolute-path prefix matching usingresolve_filter_paths()+str::starts_with()find_all_snapshots()tokarva_snapshot::storagefor discovering both.snapand.snap.newfilesrun_reviewto accept resolved&[Utf8PathBuf]filters instead of raw&[String]Test plan
test_snapshot_prune_with_path_filterto use correct path prefix filterjust test)prek run -apasses (clippy, fmt, etc.)cargo run -p karva_dev generate-all🤖 Generated with Claude Code