Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.
Swift cache-cleanercleanerclideveloper-toolsdisk-cleanupdisk-spaceduplicate-finderhomebrewliquid-glassmac-cleanermacosmacos-appmacos-golden-gatemacos-tahoemacos-tweaksswiftswiftuiterminal-themesuninstalluninstaller
Say that peel's JSON keeps a name whole
Țugui Dragoș3f4256a671ad
diff --git a/ARCHITECTURE.md b/ARCHITECTURE.mdindex db95b984..a27e343f 100644--- a/ARCHITECTURE.md+++ b/ARCHITECTURE.md@@ -463,7 +463,8 @@ each item, stop there with `--dry-run`, ask unless given `-y`, exit 2 when the acouldn't finish, and write the same History the app shows. The tool never uses the helper. Everything it prints goesthrough `Output`, so scripts can read it: its own words are plain ASCII, and names, paths, and what macOS says in anerror are printed as they are, in UTF-8, with every character that could hide or reorder text shown as `?`-(`PlainText`). A long scan says how far it has got on one line of standard error, written over itself and cleared+(`PlainText`). JSON keeps each value whole, by JSON's own rules, since a script needs the real name. A long scan says+how far it has got on one line of standard error, written over itself and clearedbefore anything else is printed (`ProgressLine`). Only a terminal shows it, and only while `peel` is its foregroundjob, so a script reading standard error gets nothing.diff --git a/Packages/PeelCore/Tests/PeelCoreTests/CommandLineTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/CommandLineTests.swiftindex eb44c6b8..332489f3 100644--- a/Packages/PeelCore/Tests/PeelCoreTests/CommandLineTests.swift+++ b/Packages/PeelCore/Tests/PeelCoreTests/CommandLineTests.swift@@ -544,6 +544,13 @@ struct CommandLineTests {== "No leftovers Peel suggests. 11 files need review. Add --all to see them.")}+ @Test func textHidesWhatCouldReorderANameAndJSONKeepsItWhole() throws {+ let name = "Notes\u{202E}.app"++ #expect(Output.plain(name) == "Notes?.app")+ #expect(try Output.jsonText(["name": name]).contains(name))+ }+@Test func withoutASubcommandItShowsTheHelpAndFails() async throws {let command = try #require(try PeelCommand.parseAsRoot([]) as? PeelCommand)let collected = Output.Collected()diff --git a/Packages/PeelCore/Tests/PeelCoreTests/DocumentationTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/DocumentationTests.swiftindex f76457b1..5f9df7b1 100644--- a/Packages/PeelCore/Tests/PeelCoreTests/DocumentationTests.swift+++ b/Packages/PeelCore/Tests/PeelCoreTests/DocumentationTests.swift@@ -55,6 +55,7 @@ struct DocumentationTests {("SAFETY.md", "at most \(HelperRequest.maximumItems) items in one request"),("SAFETY.md", "and the \(LibraryFolder.plugIns.count) that hold plug-ins"),("ARCHITECTURE.md", "at most \(HelperRequest.maximumItems) items"),+ ("ARCHITECTURE.md", "JSON keeps each value whole"),("ARCHITECTURE.md", "answers, within \(Int(PrivilegedHelper.answerWait)) seconds"),("ARCHITECTURE.md", "at most \(Int(PrivilegedHelper.requestWait)) seconds for a request"),("SAFETY.md", "quits \(idle) seconds after its last request ends"),