Sha256: 02b9916eabdb5f00f86efc0088a3396b42037c0e32c4c07d2a795cffd3841133
Contents?: true
Size: 609 Bytes
Versions: 9
Compression:
Stored size: 609 Bytes
Contents
# frozen_string_literal: true module RuboCop module Cop module Lint # Checks for empty interpolation. # # @example # # # bad # "result is #{}" # # # good # "result is #{some_result}" class EmptyInterpolation < Base include Interpolation extend AutoCorrector MSG = 'Empty interpolation detected.' def on_interpolation(begin_node) return unless begin_node.children.empty? add_offense(begin_node) { |corrector| corrector.remove(begin_node) } end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems