Sha256: 981d08652ed0d8040a73331d1b14769442091f09a75c355d600e1b327da3952b
Contents?: true
Size: 627 Bytes
Versions: 9
Compression:
Stored size: 627 Bytes
Contents
# frozen_string_literal: true module RuboCop module Cop module Lint # This cop checks for empty interpolation. # # @example # # "result is #{}" class EmptyInterpolation < Cop MSG = 'Empty interpolation detected.'.freeze def on_dstr(node) node.each_child_node(:begin) do |begin_node| add_offense(begin_node, :expression) if begin_node.children.empty? end end def autocorrect(node) lambda do |collector| collector.remove(node.loc.expression) end end end end end end
Version data entries
9 entries across 9 versions & 2 rubygems