Sha256: 5b8fee3c242501f0059542c5a356175f1be050ee05a9d960bdb0b648c597c22a
Contents?: true
Size: 611 Bytes
Versions: 9
Compression:
Stored size: 611 Bytes
Contents
# frozen_string_literal: true module RuboCop module Cop module Lint # This cop checks for the presence of empty expressions. # # @example # # @bad # foo = () # if () # bar # end class EmptyExpression < Cop MSG = 'Avoid empty expressions.'.freeze def on_begin(node) return unless empty_expression?(node) add_offense(node, node.source_range, MSG) end private def empty_expression?(begin_node) begin_node.children.empty? end end end end end
Version data entries
9 entries across 9 versions & 2 rubygems