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.

Offer what Pants keeps in a repository

Țugui Dragoș0f9f49b371d9
diff --git a/Packages/PeelCore/Sources/PeelCore/Developer/ProjectArtifacts.swift b/Packages/PeelCore/Sources/PeelCore/Developer/ProjectArtifacts.swift
index 083a529b..643d4b41 100644
--- a/Packages/PeelCore/Sources/PeelCore/Developer/ProjectArtifacts.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Developer/ProjectArtifacts.swift
@@ -405,6 +405,12 @@ public enum ProjectArtifacts {
name: ".pixi/envs", markers: ["pixi.toml", "pyproject.toml"], tool: "Pixi", isGeneric: false,
source: "https://github.com/prefix-dev/pixi/blob/98535e0857e25ddc89457ef4779be2a961d8c2df/docs/workspace/environment.md#L70-L141"
),
+ Definition(
+ name: ".pants.d", markers: ["pants.toml"], tool: "Pants", isGeneric: false, source: "https://github.com/pantsbuild/pants/blob/5ec37d43741c80b9e7e999a51ef12cc3e6f3a6c8/docs/docs/using-pants/troubleshooting-common-issues.mdx#L153-L167"
+ ),
+ Definition(
+ name: "dist", markers: ["pants.toml"], tool: "Pants", isGeneric: true, source: "https://github.com/pantsbuild/pants/blob/5ec37d43741c80b9e7e999a51ef12cc3e6f3a6c8/docs/docs/using-pants/troubleshooting-common-issues.mdx#L153-L167"
+ ),
Definition(
name: "dist", markers: ["pyproject.toml"], tool: "Python", isGeneric: true,
source: "https://packaging.python.org/en/latest/tutorials/packaging-projects/"
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/ProjectArtifactsTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/ProjectArtifactsTests.swift
index 07ffdbc7..5d54b0df 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/ProjectArtifactsTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/ProjectArtifactsTests.swift
@@ -496,6 +496,20 @@ struct ProjectArtifactsTests {
#expect(found.first?.isRecommended == true)
}
+ @Test func offersWhatPantsSaysIsSafeToDeleteInARepository() async throws {
+ let directory = try TemporaryDirectory()
+ try directory.file("repo/pants.toml", bytes: 16)
+ try directory.file("repo/.pants.d/workdir/pantsd/pantsd.log", bytes: 400_000)
+ try directory.file("repo/dist/app.pex", bytes: 400_000)
+ try age(directory.url, days: 60)
+
+ let found = await ProjectArtifacts.scan(roots: [directory.url]).artifacts
+
+ #expect(found.map(\.name).sorted() == [".pants.d", "dist"])
+ #expect(found.allSatisfy { $0.tool == "Pants" })
+ #expect(found.filter(\.isRecommended).map(\.name) == [".pants.d"])
+ }
+
@Test func offersWhatElixirsLanguageServersKeepInAProject() async throws {
let directory = try TemporaryDirectory()
try directory.file("api/mix.exs", bytes: 16)