Skip to content

armgit / peel

Public Imported from GitHub
0

Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.

Put five comments back above the declarations they describe

Țugui Dragoșd58036989108
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/DuplicateFinderTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/DuplicateFinderTests.swift
index 3e9580eb..6a3c87a4 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/DuplicateFinderTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/DuplicateFinderTests.swift
@@ -14,8 +14,6 @@ struct DuplicateFinderTests {
#expect(DuplicateScan.canChange(copies[1], among: copies, selected: [copies[0], copies[1]]), "a selected copy can always go back")
}
- /// Verifying reads a mebibyte at a time, and each report is a transaction on the main actor. So reports are
- /// let through at most once every 50 ms, and the last one is always let through.
@Test func aReadThatNeverAnswersHoldsNeitherAStoppedScanNorItsThreads() async throws {
let stuck = Stuck()
let reading = Task {
@@ -84,6 +82,8 @@ struct DuplicateFinderTests {
}
}
+ /// Verifying reads a mebibyte at a time, and each report is a transaction on the main actor. So reports are
+ /// let through at most once every 50 ms, and the last one is always let through.
@Test func reportsReadingAtARateTheScreenCanTake() {
let reports = Mutex<[DuplicateScanProgress]>([])
let reading = ReadProgress(bytesToRead: 1_000) { update in reports.withLock { $0.append(update) } }
@@ -336,9 +336,6 @@ struct DuplicateFinderTests {
#expect(inside.groups.isEmpty, "a folder inside a repository was scanned")
}
- /// A folder that syncs to other devices is scanned, and each copy found in it is listed and held back: a copy
- /// moved there would be removed from every device. Nothing in such a group is suggested, since the one copy that
- /// could move is the only one that stays on this Mac.
@Test func countsOnlyTheGroupsWithSomethingToMove() async throws {
let directory = try TemporaryDirectory()
let synced = randomData(count: 3_000)
@@ -355,6 +352,9 @@ struct DuplicateFinderTests {
#expect(scan.groupsWithSomethingToMove == 1)
}
+ /// A folder that syncs to other devices is scanned, and each copy found in it is listed and held back: a copy
+ /// moved there would be removed from every device. Nothing in such a group is suggested, since the one copy that
+ /// could move is the only one that stays on this Mac.
@Test func listsACopyThatSyncsApartAndNeverSelectsIt() async throws {
let directory = try TemporaryDirectory()
let contents = randomData(count: 3_000)
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/InstallersTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/InstallersTests.swift
index d1e5f3b1..6012c3b7 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/InstallersTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/InstallersTests.swift
@@ -4,8 +4,6 @@ import Synchronization
import Testing
struct InstallersTests {
- /// The macOS installers and the firmware are scanned after the downloads, and those later steps must stop
- /// as well.
@Test func aSearchFindsAnItemByWhatItsRowShows() {
func item(
_ name: String, kind: InstallerItem.Kind, for app: String? = nil, notes: [InstallerItem.Note] = []
@@ -25,6 +23,8 @@ struct InstallersTests {
#expect(!update.matches("slack") && !installer.matches("firefox"))
}
+ /// The macOS installers and the firmware are scanned after the downloads, and those later steps must stop
+ /// as well.
@Test func aStoppedScanStops() async throws {
let directory = try TemporaryDirectory()
for index in 1...30 {
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/RefusalLogTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/RefusalLogTests.swift
index 31184d9d..44206637 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/RefusalLogTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/RefusalLogTests.swift
@@ -101,8 +101,6 @@ struct RefusalLogTests {
#expect(!FileManager.default.fileExists(atPath: url.path(percentEncoded: false)))
}
- /// Past its cap the log drops the oldest removals whole, as History does: an entry cut in part would read as
- /// all that was refused.
@Test func neverWritesMoreThanItReadsBack() async throws {
let directory = try TemporaryDirectory()
let url = directory.url.appending(path: "Peel/refusals.json")
@@ -121,6 +119,8 @@ struct RefusalLogTests {
#expect(!batches.contains(removals[0]), "the oldest removal was kept past the limit")
}
+ /// Past its cap the log drops the oldest removals whole, as History does: an entry cut in part would read as
+ /// all that was refused.
@Test func dropsTheOldestRemovalsWhole() async throws {
let directory = try TemporaryDirectory()
let log = RefusalLog(url: directory.url.appending(path: "refusals.json"))
diff --git a/Peel/Views/Extensions/ExtensionList.swift b/Peel/Views/Extensions/ExtensionList.swift
index 6176a1c5..bf8ae598 100644
--- a/Peel/Views/Extensions/ExtensionList.swift
+++ b/Peel/Views/Extensions/ExtensionList.swift
@@ -80,7 +80,6 @@ struct ExtensionList: View {
.rescanOnExclusionChange("ExtensionList") { await extensions.refresh() }
}
- /// Why an empty list says nothing: the one kind macOS gave no answer about, or both.
/// What VoiceOver hears when a scan ends: what it found, and that part of the list is missing when it is.
private var announcement: AttributedString? {
guard let found = extensions.summary else { return nil }
@@ -88,6 +87,7 @@ struct ExtensionList: View {
return found + " " + AttributedString(localized: "Part of this list is missing.")
}
+ /// Why an empty list says nothing: the one kind macOS gave no answer about, or both.
private var unansweredDescription: Text {
if extensions.unanswered.count == 1, let missing = extensions.unanswered.first {
return Text(missing.unansweredNote)