Repository navigation
Leave empty files out of the Stats duplicates and fold extension case - #174
Merged
Merged
Conversation
… [patch] Empty files are never deleted, but Stats still counted every empty copy as a duplicate, credited it to its extension and listed empty groups among the largest, so a Python tree reported dozens of redundant __init__.py files that DryRun would keep. Stats now counts only deletable groups and reports empty copies on their own line, and .JPG and .jpg are counted as one extension. Fixes #172 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EMKbHPuiquQwvUr7NBWPvL
|
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.



Fixes #172
What changed (
Verbs/Stats.csonly)Deduplicator.IsDeletable. Every other verb has used that set since Deduplicate deletes all but one empty file (__init__.py, .gitkeep, py.typed) while reclaiming 0 bytes #151. "Duplicate files", "Duplicate groups", "Wasted space", the extension breakdown and the largest-groups list now match what DryRun and Deduplicate would actually remove.Empty duplicates (never deleted): N. "Total files" still adds up: unique, plus duplicate, plus empty duplicates, plus unreadable..JPGand.jpgcopies fall under one.jpgline.Tests (
VerbOutputTests)StatsLeavesEmptyFilesOutOfTheDuplicatesuses the tree from the issue. Stats reportsDuplicate files: 1,.jpg: 1 file(s), no.pyline, no empty group in the largest list, andEmpty duplicates (never deleted): 3. DryRun reportsFiles to delete: 1.StatsCountsExtensionsThatDifferOnlyInCaseTogether: three mixed-case.jpg/.JPGpairs give one line,.jpg: 3 file(s).With
Stats.csreverted, both new tests fail. With the change, the full suite passes locally: 81 passed, 3 skipped. The 3 skips already existed and need a non-root user. The existing Stats tests pass unchanged.This PR is independent of #173 (the #140 fix); each branches from
main.🤖 Generated with Claude Code
https://claude.ai/code/session_01EMKbHPuiquQwvUr7NBWPvL
Generated by Claude Code