<commit_before># encoding: utf-8
# frozen_string_literal: true
module RuboCop
  module Cop
    module Style
      # Check for parentheses around stabby lambda arguments.
      # There are two different styles. Defaults to `require_parentheses`.
      #
      # @example
      #   # require_parentheses - bad
      #   ->a,b,c { a + b + c }
      #
      #   # require_parentheses - good
      #   ->(a,b,c) { a + b + c}
      #
      #   # require_no_parentheses - bad
      #   ->(a,b,c) { a + b + c }
      #
      #   # require_parentheses - good
      #   ->a,b,c { a + b + c}
      class StabbyLambdaParentheses < Cop
        include ConfigurableEnforcedStyle

        MSG_REQUIRE = 'Wrap stabby lambda arguments with parentheses.'.freeze
        MSG_NO_REQUIRE = 'Do not wrap stabby lambda arguments ' \
                         'with parentheses.'.freeze
        ARROW = '->'.freeze

        def on_send(node)
          return unless arrow_lambda_with_args?(node)

          if style == :require_parentheses
            if parentheses?(node)
              correct_style_detected
            else
              missing_parentheses(node)
            end<commit_msg>Fix doc typo for stabby lambda parentheses (#3082)<commit_after># encoding: utf-8
# frozen_string_literal: true
module RuboCop
  module Cop
    module Style
      # Check for parentheses around stabby lambda arguments.
      # There are two different styles. Defaults to `require_parentheses`.
      #
      # @example
      #   # require_parentheses - bad
      #   ->a,b,c { a + b + c }
      #
      #   # require_parentheses - good
      #   ->(a,b,c) { a + b + c}
      #
      #   # require_no_parentheses - bad
      #   ->(a,b,c) { a + b + c }
      #
      #   # require_no_parentheses - good
      #   ->a,b,c { a + b + c}
      class StabbyLambdaParentheses < Cop
        include ConfigurableEnforcedStyle

        MSG_REQUIRE = 'Wrap stabby lambda arguments with parentheses.'.freeze
        MSG_NO_REQUIRE = 'Do not wrap stabby lambda arguments ' \
                         'with parentheses.'.freeze
        ARROW = '->'.freeze

        def on_send(node)
          return unless arrow_lambda_with_args?(node)

          if style == :require_parentheses
            if parentheses?(node)
              correct_style_detected
            else
              missing_parentheses(node)
            end
{'fraction_non_alphanumeric': 0.09033613445378151, 'fraction_numerical': 0.0025210084033613447, 'mean_word_length': 1.8011764705882354, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '6074522', 'n_tokens_mistral': 744, 'n_tokens_neox': 701, 'n_words': 182}