<commit_before># frozen_string_literal: true

module RuboCop
  module Cop
    module Style
      # Checks for parentheses for empty lambda parameters. Parentheses
      # for empty lambda parameters do not cause syntax errors, but they are
      # redundant.
      #
      # @example
      #   # bad
      #   -> () { do_something }
      #
      #   # good
      #   -> { do_something }
      #
      #   # good
      #   -> (arg) { do_something(arg) }
      class EmptyLambdaParameter < Base
        include EmptyParameter
        include RangeHelp
        extend AutoCorrector

        MSG = 'Omit parentheses for the empty lambda parameters.'

        def on_block(node)
          send_node = node.send_node
          return unless send_node.send_type?

          check(node) if node.send_node.lambda_literal?
        end

        private

        def autocorrect(corrector, node)
          send_node = node.parent.send_node
          range = range_between(send_node.loc.expression.end_pos, node.loc.expression.end_pos)

          corrector.remove(range)
        end
      end<commit_msg>Disable InternalAffairs/NumblockHandler for Style/EmptyLambdaParameter<commit_after># frozen_string_literal: true

module RuboCop
  module Cop
    module Style
      # Checks for parentheses for empty lambda parameters. Parentheses
      # for empty lambda parameters do not cause syntax errors, but they are
      # redundant.
      #
      # @example
      #   # bad
      #   -> () { do_something }
      #
      #   # good
      #   -> { do_something }
      #
      #   # good
      #   -> (arg) { do_something(arg) }
      class EmptyLambdaParameter < Base
        include EmptyParameter
        include RangeHelp
        extend AutoCorrector

        MSG = 'Omit parentheses for the empty lambda parameters.'

        def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler
          send_node = node.send_node
          return unless send_node.send_type?

          check(node) if node.send_node.lambda_literal?
        end

        private

        def autocorrect(corrector, node)
          send_node = node.parent.send_node
          range = range_between(send_node.loc.expression.end_pos, node.loc.expression.end_pos)

          corrector.remove(range)
        end
      end
{'fraction_non_alphanumeric': 0.07027498908773461, 'fraction_numerical': 0.0, 'mean_word_length': 2.0237467018469655, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5555698', 'n_tokens_mistral': 659, 'n_tokens_neox': 626, 'n_words': 160}