SwiftFormat
SwiftFormat copied to clipboard
unusedPrivateDeclarations Deleting private funcs in extensions
Say you've got this
class MyClass {
func doSomething() {
doTheThing()
}
}
extension MyClass {
private func doTheThing() {
}
}
doTheThing will be deleted for being unused. I guess it's just checking if it's used within the extension itself.
When I test the unusedPrivateDeclarations rule with this sample code, the private func doTheThing() is not removed (the rule correctly notices that the doTheThing method is not unused).