Sha256: 6de1391f54e756161063f6ed8d8f2631ad34f1f892b783fbc9226c31c9c031c4
Contents?: true
Size: 685 Bytes
Versions: 16
Compression:
Stored size: 685 Bytes
Contents
# frozen_string_literal: true module RuboCop module Cop module Lint # This cop looks for uses of flip-flop operator. # flip-flop operator is deprecated since Ruby 2.6.0. # # @example # # bad # (1..20).each do |x| # puts x if (x == 5) .. (x == 10) # end # # # good # (1..20).each do |x| # puts x if (x >= 5) && (x <= 10) # end class FlipFlop < Base MSG = 'Avoid the use of flip-flop operators.' def on_iflipflop(node) add_offense(node) end def on_eflipflop(node) add_offense(node) end end end end end
Version data entries
16 entries across 16 versions & 3 rubygems