You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a continuation of Ruby Style Guide issue 307. Let me start out by saying that I understand and tend to agree with what @anthonyryan1 had to say when he closed the issue, before @bbatsov recommended I open a new automation issue on the topic.
I'd suggest that
a :refactor or :convention notice (which?) be emitted when the source being examined includes calls to both:is_a?and:kind_of?, suggesting to the developer that s/he might want to standardise on one or the other.
that be raised to an :error-level offence when the configuration contains a Preferred: is_a? or Preferred: kind_of? setting for this cop.
that the scope of comparison for (1) and (2) be optionally limited by a LimitedTo: configuration setting with the allowable settings of File, Class or Method. Specifying Default, or omitting the LimitedTo: configuration entirely, defaults the scope to all files being examined.
You could well argue, and I'd agree, that this would be a pretty arbitrarily limited form of what was being grappled with in the earlier issue. On the other hand, it "shouldn't" be incredibly hard to implement.
Thoughts?
The text was updated successfully, but these errors were encountered:
This is a continuation of Ruby Style Guide issue 307. Let me start out by saying that I understand and tend to agree with what @anthonyryan1 had to say when he closed the issue, before @bbatsov recommended I open a new automation issue on the topic.
I'd suggest that
:refactor
or:convention
notice (which?) be emitted when the source being examined includes calls to both:is_a?
and:kind_of?
, suggesting to the developer that s/he might want to standardise on one or the other.:error
-level offence when the configuration contains aPreferred: is_a?
orPreferred: kind_of?
setting for this cop.LimitedTo:
configuration setting with the allowable settings ofFile
,Class
orMethod
. SpecifyingDefault
, or omitting theLimitedTo:
configuration entirely, defaults the scope to all files being examined.You could well argue, and I'd agree, that this would be a pretty arbitrarily limited form of what was being grappled with in the earlier issue. On the other hand, it "shouldn't" be incredibly hard to implement.
Thoughts?
The text was updated successfully, but these errors were encountered: