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

New Cop: Avoid usage of Class.descendents #110

Open
bensheldon opened this issue Aug 4, 2022 · 0 comments
Open

New Cop: Avoid usage of Class.descendents #110

bensheldon opened this issue Aug 4, 2022 · 0 comments

Comments

@bensheldon
Copy link
Contributor

There are two reasons why this is an unreliable solution:

  • it doesn't know about things that have yet to be autoloaded
  • it's non-deterministic with regards to Garbage Collection of classes. If you use Class.descendants in Test, where there is a pattern to dynamically define classes, GC is unpredictable for when those classes are cleaned up and removed by the GC.

cc @jhawthorn

@bensheldon bensheldon changed the title Avoid usage of Class.descendents New Cop: Avoid usage of Class.descendents Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant