Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NSObject subclasses are not flagged #729

Open
scottasoutherland opened this issue Apr 23, 2024 · 2 comments
Open

NSObject subclasses are not flagged #729

scottasoutherland opened this issue Apr 23, 2024 · 2 comments
Labels
question Further information is requested

Comments

@scottasoutherland
Copy link

We are running periphery scan with only the parameters

--workspace , --schemes, --targets , we notice that subclasses of NSObject are not flagged as unused. I know you mention in the README that there is special treatment of objective-c runtime accessible classes, but if I understand it correctly, they should by default be caught unless --retain-objc-accessible is passed or the class is annotated with @objc and --retain-objc-annotated is passed, but this does not appear to be true. To be sure i didn't misunderstand, i did try running with those flags and they still are not caught.

I see there are tests to ensure those flags don't flag obj-c members ( https://github.com/peripheryapp/periphery/tree/master/Tests/Fixtures/ObjcAnnotatedRetentionFixtures ) but I don't see any tests around catching them, but I haven't looked extensively.

@ileitch
Copy link
Contributor

ileitch commented Apr 29, 2024

You're correct that it should identify NSObject subclasses by default. Are you seeing this for all subclass or just some? If you can provide an example project that reproduces the issue I can take a look at what's going wrong.

@ileitch ileitch added the question Further information is requested label Apr 29, 2024
@scottasoutherland
Copy link
Author

I spent a little bit of time on this. It seems in very simple cases it works as expected. So it must be something specific to our project setup that is causing it. I'll keep digging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants