Skip to content

Commit 2e5103d

Browse files
pftgclaude
andauthored
fix: deduplicate glob results in snap_diff:clean rake task (#178)
Overlapping globs (*.diff.png matches *.base.diff.png and *.heatmap.diff.png) produced duplicate paths, causing the "Removed N" count to over-report. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e032565 commit 2e5103d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ task "snap_diff:clean" do
4040
patterns = ["**/*.diff.png", "**/*.base.diff.png", "**/*.heatmap.diff.png",
4141
"**/*.diff.webp", "**/*.base.diff.webp", "**/*.heatmap.diff.webp",
4242
"**/snap_diff_report.html"]
43-
removed = patterns.flat_map { |p| Dir.glob("tmp/#{p}") + Dir.glob("doc/screenshots/#{p}") }
43+
removed = patterns.flat_map { |p| Dir.glob("tmp/#{p}") + Dir.glob("doc/screenshots/#{p}") }.uniq
4444
removed.each { |f| FileUtils.rm_f(f) }
4545
puts "Removed #{removed.size} diff artifacts"
4646
end

0 commit comments

Comments
 (0)