Skip to content

Commit 3d4da68

Browse files
committed
0.1.7
Features: - Better display of sizes Fixes: - changed Windows user mode dump to `memory dump` entity category Rules: - added DaVinci Resolve crash dumps - added DaVinci Resolve logs - added Microsoft Visual Studio telemetry - added Cyberpunk 2077 crash reports Schema: - added `editing software` category - added `memory dump` entity category Documentation: - added `editing software category`
1 parent 3386f39 commit 3d4da68

6 files changed

+105
-35
lines changed

cleanup-list.json

+58-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"windows_user_mode_dumps": {
8181
"application": "Windows",
8282
"category": "Windows",
83-
"entity_category": "crash log",
83+
"entity_category": "memory dump",
8484
"description": "Windows User-Mode application crash dump logs.",
8585
"delete": {
8686
"type": "file",
@@ -132,5 +132,61 @@
132132
"location": "~/AppData/Local/Microsoft/Windows/Explorer/thumbcache*.db"
133133
},
134134
"active": true
135-
}
135+
},
136+
"davinci_resolve_crash_dump": {
137+
"application": "DaVinci Resolve",
138+
"category": "editing software",
139+
"entity_category": "memory dump",
140+
"description": "Crash memory dump.",
141+
"delete": {
142+
"type": "file",
143+
"location": "~/AppData/Roaming/Blackmagic Design/DaVinci Resolve/Support/logs/Resolve.exe.*.dmp"
144+
},
145+
"active": true
146+
},
147+
"davinci_resolve_logs_1": {
148+
"application": "DaVinci Resolve",
149+
"category": "editing software",
150+
"entity_category": "log",
151+
"description": "Application logs.",
152+
"delete": {
153+
"type": "file",
154+
"location": "~/AppData/Roaming/Blackmagic Design/DaVinci Resolve/Support/logs/*.log"
155+
},
156+
"active": true
157+
},
158+
"davinci_resolve_logs_2": {
159+
"application": "DaVinci Resolve",
160+
"category": "editing software",
161+
"entity_category": "log",
162+
"description": "Application logs.",
163+
"delete": {
164+
"type": "file",
165+
"location": "~/AppData/Roaming/Blackmagic Design/DaVinci Resolve/Support/logs/LogArchive/*.txt"
166+
},
167+
"active": true
168+
},
169+
"microsoft_visual_studio_telemetry": {
170+
"application": "Visual Studio",
171+
"category": "IDE",
172+
"entity_category": "telemetry",
173+
"description": "Visual Studio Telemetry",
174+
"instructions": "Disable telemetry in Visual Studio at `Help > Privacy > Privacy Settings`.",
175+
"delete": {
176+
"type": "directory",
177+
"location": "~/AppData/Local/Temp/VSTelem"
178+
},
179+
"active": true
180+
},
181+
"cyberpunk_2077_crash_report_queue": {
182+
"application": "Cyberpunk 2077",
183+
"category": "game",
184+
"entity_category": "crash log",
185+
"description": "Cyberpunk 2077 crash logs and memory dumps.",
186+
"delete": {
187+
"type": "directory",
188+
"location": "~/AppData/Local/REDEngine/ReportQueue"
189+
},
190+
"active": true
191+
}
136192
}

cleanup-list.schema.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
"AI",
2727
"communication",
2828
"game",
29-
"hardware"
29+
"hardware",
30+
"editing software"
3031
]
3132
},
3233
"entity_category": {
@@ -38,7 +39,8 @@
3839
"backup",
3940
"old version",
4041
"temporary files",
41-
"telemetry"
42+
"telemetry",
43+
"memory dump"
4244
]
4345
},
4446
"custom_category": {

constup-garbage-cleaner.ps1

+8-4
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,11 @@ if (Test-Path $cleanupListFile)
134134
$rule = $fileItem.rule
135135
$location = $fileItem.location
136136
$size = $fileItem.size
137+
$calculatedSize = Calculate-Size -size $size
137138

138139
Write-Host $rule
139140
Write-Host " Location: $location"
140-
Write-Host " Size: $size"
141+
Write-Host " Size: $size / $calculatedSize"
141142
}
142143
} else {
143144
Write-Host "There are no files to delete."
@@ -151,10 +152,11 @@ if (Test-Path $cleanupListFile)
151152
$rule = $directoryItem.rule
152153
$location = $directoryItem.location
153154
$size = $directoryItem.size
155+
$calculatedSize = Calculate-Size -size $size
154156

155157
Write-Host $rule
156158
Write-Host " Location: $location"
157-
Write-Host " Size: $size"
159+
Write-Host " Size: $size / $calculatedSize"
158160
}
159161
} else {
160162
Write-Host "There are no directories to delete."
@@ -186,7 +188,8 @@ if (Test-Path $cleanupListFile)
186188
$registryEntries = $entities.totalRegistryEntries
187189
Write-Host 'Dry run summary:'
188190
Write-Host '----------'
189-
Display-Size($size)
191+
$calculatedSize = Calculate-Size -size $size
192+
Write-Host "Total space saved: $calculatedSize"
190193
Write-Host "Total space saved (in exact bytes): $size"
191194
Write-Host "Total registry entries to delete: $registryEntries"
192195
Write-Host "----------"
@@ -290,7 +293,8 @@ if (Test-Path $cleanupListFile)
290293
Write-Host '----------'
291294
}
292295

293-
Display-Size($totalSize)
296+
$calculatedSize= Calculate-Size -size $totalSize
297+
Write-Host "Total space saved: $calculatedSize"
294298
Write-Host "Total space saved (in exact bytes): $totalSize"
295299
Write-Host "Total registry entries deleted: $totalRegistryEntries"
296300
}

doc/categories.adoc

+3
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ https://github.com/constup/garbage-cleaner/issues[issue].
6262

6363
|`hardware`
6464
|Hardware related files.
65+
66+
|`editing software`
67+
|Software for editing of text, audio, video, 3D,...
6568
|===
6669

6770
== Links

src/math.ps1

+13-10
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
function Display-Size {
1+
function Calculate-Size {
22
param (
33
[Parameter(Mandatory=$true)]
44
[long]$size
55
)
66

7-
if ($size -gt 1024*1024*1024) {
8-
$size = $size / 1GB
9-
Write-Host "Total space saved: $size GB"
7+
if ($size -ge 1GB) {
8+
$result = [math]::Round($size / 1GB, 2)
9+
return "$result GB"
10+
} elseif ($size -ge 1MB) {
11+
$result = [math]::Round($size / 1MB, 2)
12+
return "$result MB"
1013
}
11-
elseif ($size -gt 1024*1024) {
12-
$size = $size / 1MB
13-
Write-Host "Total space saved: $size MB"
14-
} elseif ($size -gt 1024) {
15-
$size = $size / 1KB
16-
Write-Host "Total space saved: $size KB"
14+
elseif ($size -ge 1KB) {
15+
$result = [math]::Round($size / 1KB, 2)
16+
return "$result KB"
17+
}
18+
else {
19+
return "$size B"
1720
}
1821
}

tests/math.Tests.ps1

+19-17
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,35 @@
1-
Describe 'Display-Size' {
1+
Describe 'Calculate-Size' {
22
BeforeAll {
33
. $PSScriptRoot/../src/math.ps1
44
Mock Write-Host {}
55
}
66

7-
It 'Should display size in KB.' {
8-
Display-Size -size 1025
7+
It 'Should calculate size in KB.' {
8+
$result = Calculate-Size -size 1025
9+
$result | Should -Be "1 KB"
910

10-
Should -Invoke Write-Host -Exactly 1
11-
Should -Invoke Write-Host -Exactly 1 -ParameterFilter { $Object -eq "Total space saved: 1 KB" }
11+
$result = Calculate-Size -size 1423
12+
$result | Should -Be "1.39 KB"
1213
}
1314

14-
It 'Should display size in MB.' {
15-
Display-Size -size 1048577
15+
It 'Should calculate size in MB.' {
16+
$result = Calculate-Size -size 1048577
17+
$result | Should -Be "1 MB"
1618

17-
Should -Invoke Write-Host -Exactly 1
18-
Should -Invoke Write-Host -Exactly 1 -ParameterFilter { $Object -eq "Total space saved: 1 MB" }
19+
$result = Calculate-Size -size 1457520
20+
$result | Should -Be "1.39 MB"
1921
}
2022

21-
It 'Should display size in GB.' {
22-
Display-Size -size 1073741825
23+
It 'Should calculate size in GB.' {
24+
$result = Calculate-Size -size 1073741825
25+
$result | Should -Be "1 GB"
2326

24-
Should -Invoke Write-Host -Exactly 1
25-
Should -Invoke Write-Host -Exactly 1 -ParameterFilter { $Object -eq "Total space saved: 1 GB" }
27+
$result = Calculate-Size -size 1492501135
28+
$result | Should -Be "1.39 GB"
2629
}
2730

28-
It 'Should not display anything.' {
29-
Display-Size -size 1023
30-
31-
Should -Not -Invoke Write-Host
31+
It 'Should not calculate anything.' {
32+
$result = Calculate-Size -size 1023
33+
$result | Should -Be "1023 B"
3234
}
3335
}

0 commit comments

Comments
 (0)