Closed
Description
I recently remembered that ActiveSupport adds an exclude?
method to Array and String. Before that, I was just using !foo.include?
.
I would like to suggest a new cop that detects usage of !foo.include?(bar)
, and can auto-fix it to: foo.exclude?(bar)
.
Does that seem like a good idea to anyone else? I really like the exclude?
method because it's easier to see the intention. (Similar to unless
vs if
.)
Activity