feat: Introduce remove UnnecessaryTestable subcommand#5
Merged
michaelversus merged 1 commit intomasterfrom Jan 16, 2026
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #5 +/- ##
==========================================
- Coverage 95.47% 93.19% -2.28%
==========================================
Files 20 32 +12
Lines 1082 1926 +844
==========================================
+ Hits 1033 1795 +762
- Misses 49 131 +82 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Remove Unnecessary @testable Imports & CLI Restructure
🎯 Overview
This PR introduces a major new feature to automatically detect and remove unnecessary
@testable importstatements from Swift test files, while also restructuring the CLI to use subcommands for better extensibility.🚨 Breaking Changes
CLI Structure Migration
--verboseis now a flag (no value required) instead of an option.swiftfindrefs --verbose trueswiftfindrefs search -vorswiftfindrefs search --verbose✨ New Features
Remove Unnecessary Testable Imports Subcommand
removeUnnecessaryTestableImports(alias:rmUTI)@testable importstatements that are no longer needed@testable)--excludeCompilationConditionalsflagExample usage:
swiftfindrefs removeUnnecessaryTestableImports --projectName MyApp --verbose --excludeCompilationConditionals # or using the alias: swiftfindrefs rmUTI -p MyApp -v --excludeCompilationConditionalsConditional Compilation Support
--excludeCompilationConditionalsflag to exclude@testable importstatements inside#if/#elseif/#else/#endifblocks⚡ Performance Improvements
Async/Await Migration
TaskGroupfor parallel processing of files and unitsURL.resourceBytes.linesfor efficient async file readingOptimizations
isPublicchecks), not upfrontTaskGroupPerformance impact: ~35% faster real-time execution and ~94% reduction in CPU time for large codebases.
📚 Documentation Updates
README
removeUnnecessaryTestableImportssubcommandAgent Skill Documentation
SKILL.mdwith new command structurecli.mdwith subcommand detailsworkflows.mdwith corrected examplestroubleshooting.mdwith new command format🔧 Technical Details
File System Operations
readLines(atPath:)method toFileSystemProviderURL.resourceBytes.linesfor efficient async readingreadFileandwriteFilemethods with comprehensive testsIndexStore Integration
IndexStoreProvidingprotocol with additional methodsUnitSnapshot,OccurrenceSnapshot) for thread-safe concurrent processing🎯 Migration Guide
For users upgrading from previous versions:
Update verbose flag:
Try the new feature: