module RuboCop::Cop::ConfigurableMax

Handles ‘Max` configuration parameters, especially setting them to an appropriate value with –auto-gen-config. @deprecated Use `exclude_limit <ParameterName>` instead.

Private Instance Methods

max=(value) click to toggle source
# File lib/rubocop/cop/mixin/configurable_max.rb, line 11
      def max=(value)
        warn Rainbow(<<~WARNING).yellow, uplevel: 1
          `max=` is deprecated. Use `exclude_limit <ParameterName>` instead.
        WARNING

        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
max_parameter_name() click to toggle source
# File lib/rubocop/cop/mixin/configurable_max.rb, line 23
def max_parameter_name
  'Max'
end