periphery icon indicating copy to clipboard operation
periphery copied to clipboard

Test targets in local packages not visible

Open jfiser-paylocity opened this issue 1 year ago • 0 comments

After update to version 2.21.0, test targets in local swift packages are no longer visible to Periphery and therefore cannot be included in scan. This results in code being incorrectly reported as unused.

I think this is related to removal of the following code as part of https://github.com/peripheryapp/periphery/commit/c0846a6019304587d3c351b3cfb80cd0f20d18c8:

// Also include any test targets that depend upon this target, as they may be built by a scheme.
let testTargets = package.testTargets.filter { $0.depends(on: target) }
result[package, default: []].formUnion(testTargets)

Was removing support for test targets intentional? Is there any other way to include them in our scan? Or can this be fixed?

jfiser-paylocity avatar Jul 15 '24 07:07 jfiser-paylocity