Sha256: 13cf85cea10da535e05a0bceb262a74e929b79f220a0acc3814655f8e6c97b7d

Contents?: true

Size: 577 Bytes

Versions: 6867

Compression:

Stored size: 577 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    # Handles `Max` configuration parameters, especially setting them to an
    # appropriate value with --auto-gen-config.
    module ConfigurableMax
      private

      def max=(value)
        cfg = config_to_allow_offenses
        cfg[:exclude_limit] ||= {}
        current_max = cfg[:exclude_limit][max_parameter_name]
        value = [current_max, value].max if current_max
        cfg[:exclude_limit][max_parameter_name] = value
      end

      def max_parameter_name
        'Max'
      end
    end
  end
end

Version data entries

6,867 entries across 6,841 versions & 29 rubygems

Version Path
rubocop-0.61.1 lib/rubocop/cop/mixin/configurable_max.rb
rubocop-0.61.0 lib/rubocop/cop/mixin/configurable_max.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/rubocop-0.60.0/lib/rubocop/cop/mixin/configurable_max.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/rubocop-0.60.0/lib/rubocop/cop/mixin/configurable_max.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/rubocop-0.60.0/lib/rubocop/cop/mixin/configurable_max.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/rubocop-0.60.0/lib/rubocop/cop/mixin/configurable_max.rb
rubocop-0.60.0 lib/rubocop/cop/mixin/configurable_max.rb