Sha256: aa85b0491747742ef4c6d9826783889d69a7456c6e56b3a2d0a8cf581db300dd

Contents?: true

Size: 1.55 KB

Versions: 6814

Compression:

Stored size: 1.55 KB

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    module Naming
      # This cop checks block parameter names for how descriptive they
      # are. It is highly configurable.
      #
      # The `MinNameLength` config option takes an integer. It represents
      # the minimum amount of characters the name must be. Its default is 1.
      # The `AllowNamesEndingInNumbers` config option takes a boolean. When
      # set to false, this cop will register offenses for names ending with
      # numbers. Its default is false. The `AllowedNames` config option
      # takes an array of whitelisted names that will never register an
      # offense. The `ForbiddenNames` config option takes an array of
      # blacklisted names that will always register an offense.
      #
      # @example
      #   # bad
      #   bar do |varOne, varTwo|
      #     varOne + varTwo
      #   end
      #
      #   # With `AllowNamesEndingInNumbers` set to false
      #   foo { |num1, num2| num1 * num2 }
      #
      #   # With `MinParamNameLength` set to number greater than 1
      #   baz { |a, b, c| do_stuff(a, b, c) }
      #
      #   # good
      #   bar do |thud, fred|
      #     thud + fred
      #   end
      #
      #   foo { |speed, distance| speed * distance }
      #
      #   baz { |age, height, gender| do_stuff(age, height, gender) }
      class UncommunicativeBlockParamName < Cop
        include UncommunicativeName

        def on_block(node)
          return unless node.arguments?

          check(node, node.arguments)
        end
      end
    end
  end
end

Version data entries

6,814 entries across 6,791 versions & 25 rubygems

Version Path
cybrid_api_bank_ruby-0.123.149 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/uncommunicative_block_param_name.rb
cybrid_api_id_ruby-0.123.149 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/uncommunicative_block_param_name.rb
cybrid_api_organization_ruby-0.123.149 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/uncommunicative_block_param_name.rb
cybrid_api_bank_ruby-0.123.148 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/uncommunicative_block_param_name.rb
cybrid_api_id_ruby-0.123.148 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/uncommunicative_block_param_name.rb
cybrid_api_organization_ruby-0.123.148 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/uncommunicative_block_param_name.rb
cybrid_api_bank_ruby-0.123.147 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/uncommunicative_block_param_name.rb
cybrid_api_organization_ruby-0.123.147 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/uncommunicative_block_param_name.rb
cybrid_api_id_ruby-0.123.147 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/uncommunicative_block_param_name.rb
ory-client-1.16.2 vendor/bundle/ruby/3.1.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/uncommunicative_block_param_name.rb
avalara_sdk-24.12.2 vendor/bundle/ruby/2.7.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/uncommunicative_block_param_name.rb
cybrid_api_bank_ruby-0.123.145 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/uncommunicative_block_param_name.rb
cybrid_api_organization_ruby-0.123.145 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/uncommunicative_block_param_name.rb
cybrid_api_id_ruby-0.123.145 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/uncommunicative_block_param_name.rb
cybrid_api_bank_ruby-0.123.144 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/uncommunicative_block_param_name.rb
cybrid_api_id_ruby-0.123.144 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/uncommunicative_block_param_name.rb
cybrid_api_organization_ruby-0.123.144 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/uncommunicative_block_param_name.rb
ory-client-1.16.1 vendor/bundle/ruby/3.1.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/uncommunicative_block_param_name.rb
ory-client-1.16.0 vendor/bundle/ruby/3.1.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/uncommunicative_block_param_name.rb
cybrid_api_bank_ruby-0.123.143 vendor/bundle/ruby/3.3.0/gems/rubocop-0.66.0/lib/rubocop/cop/naming/uncommunicative_block_param_name.rb