peripheryapp / periphery

A tool to identify unused code in Swift projects.
MIT License
5.02k stars 178 forks source link

Periphery doesn't retain unused imports in retained files #748

Closed aim2120 closed 1 month ago

aim2120 commented 1 month ago

Since unused imports have become the default behavior with periphery, I've found that files that are marked as retained have started to have "unused" symbols. These are due to unused imports not being properly removed for retained files. I haven't checked if this is also the case for when comments are used to retain parts of files, but I imagine it's probably the same behavior.

This seems like a bug, unless someone can indicate that this is intended behavior.

I'm more than happy to open a PR with a fix.

ileitch commented 1 month ago

Thanks for reporting!