# frozen_string_literal: true module RuboCop module Cop module Naming # In Ruby 3.1, anonymous block forwarding has been added. # # This cop identifies places where `do_something(&block)` can be replaced # by `do_something(&)`. # # It also supports the opposite style by alternative `explicit` option. # # @example EnforcedStyle: anonymous (default) # # # bad # def foo(&block) # bar(&block) # end # # # good # def foo(&) # bar(&) # end # # @example EnforcedStyle: explicit # # # bad # def foo(&) # bar(&) # end # # # good # def foo(&block) # bar(&block) # end # class BlockForwarding < Base include ConfigurableEnforcedStyle extend AutoCorrector extend TargetRubyVersion minimum_target_ruby_version 3.1 MSG = 'Use %