feat(scanner): register global cache prune commands as vendor cleanups - #27
Merged
Conversation
Add VendorCleanups to the global scanner so `clean --vendor-cleanup` runs each package manager's native cache prune alongside path deletion. - brew cleanup -s, npm/yarn cache clean, pnpm store prune, pip/uv cache prune — all non-destructive (regenerable caches only) - tools absent from PATH are skipped, so only installed managers run; pip falls back to pip3 when pip is not on PATH - LookPath is an injectable field (mirrors ProcessRunning) for deterministic tests The destructive-command gate (docker system prune) is deferred to #17. Closes #20 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013SX3vRs78zFYA2kTRZAtg6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements #20 — the global scanner now offers each package manager's native cache-prune command through
clean --vendor-cleanup, building on theDeleteMethod/VendorCleanupcontract from #16.brew cleanup -s,npm cache clean --force,yarn cache clean,pnpm store prune,pip cache purge,uv cache prunepipfalls back topip3whenpipisn't on PATHLookPathinjectable field (mirrors the existingProcessRunningstub) keeps the test deterministic regardless of what's installed on CIrunVendorCleanupsalready collects anyVendorCleanergenerically, so the global scanner flows through the existing wiringThe destructive-command gate (
--include-destructivefordocker system prune) is deferred to #17, where an actual destructive command lands.Scope note
All global caches share one
globalecosystem, so--vendor-cleanupruns every installed manager's prune together; individual tools can't be targeted separately. Documented incommands.md.Test plan
TestGlobalScanner_VendorCleanupsstubsLookPath(brew + pip3 installed) → asserts exactly those two, the pip3 fallback surfaces inDisplay, and uninstalled tools are absentgo test ./...green;golangci-lint run0 issues; golden testdata unchanged (VendorCleanups is not serialized)clean --eco global --vendor-cleanup --dry-run --yes: yarn (uninstalled) correctly omitted, pip shown aspip3 cache purgeCloses #20
🤖 Generated with Claude Code
https://claude.ai/code/session_013SX3vRs78zFYA2kTRZAtg6