add UnreliableSubclasses cop with tests#443
Open
alexanderadam wants to merge 3 commits into
Open
Conversation
flags Class#descendants / Class#subclasses on constant (or self) receivers. skips non-constant receivers so tree-model #descendants don't false-positive.
register in default.yml + default_cops.yml as pending, require it from the top-level entry point.
include a 'good' example showing an explicit registry, plus pointers to eager loading and ActiveSupport::DescendantsTracker for cases where reflection is unavoidable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi @mattr-,
as requested this is the PR including the 👮♂️ cop.
It supersedes #356.
PS: I'm looking for a new adventure in case anybody is looking to hire someone or in case someone would like to work with a (Ruby/Rails/Crystal) dev and I'm also open to move to a PO/PM role.
PPS: If we ever ever meet, feel free to ask me about the Ruby conference guestbook