Sha256: 7b14a08e99f69682d9127a580d82e7527964d9a6858646a5f3df4ab6de255edc

Contents?: true

Size: 473 Bytes

Versions: 9

Compression:

Stored size: 473 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
      def max=(value)
        cfg = config_to_allow_offenses
        value = [cfg[max_parameter_name], value].max if cfg[max_parameter_name]
        cfg[max_parameter_name] = value
      end

      def max_parameter_name
        'Max'
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rubocop-0.52.0 lib/rubocop/cop/mixin/configurable_max.rb
rubocop-0.51.0 lib/rubocop/cop/mixin/configurable_max.rb
rubocop-0.50.0 lib/rubocop/cop/mixin/configurable_max.rb
rubocop-0.49.1 lib/rubocop/cop/mixin/configurable_max.rb
rubocop-0.49.0 lib/rubocop/cop/mixin/configurable_max.rb
rubocop-0.48.1 lib/rubocop/cop/mixin/configurable_max.rb
rubocop-0.48.0 lib/rubocop/cop/mixin/configurable_max.rb
rubocop-0.47.1 lib/rubocop/cop/mixin/configurable_max.rb
rubocop-0.47.0 lib/rubocop/cop/mixin/configurable_max.rb