123456789_123456789_123456789_123456789_123456789_

Class: RuboCop::ConfigObsoletion::CopRule Private

Do not use. This class is for internal use only.
Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Subclasses:
RuboCop::ConfigObsoletion::ExtractedCop, RuboCop::ConfigObsoletion::RemovedCop, RuboCop::ConfigObsoletion::RenamedCop, RuboCop::ConfigObsoletion::SplitCop
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Rule
Instance Chain:
self, Rule
Inherits: RuboCop::ConfigObsoletion::Rule
Defined in: lib/rubocop/config_obsoletion/cop_rule.rb

Overview

Base class for ConfigObsoletion rules relating to cops

Class Method Summary

Rule - Inherited

Instance Attribute Summary

Rule - Inherited

#cop_rule?

Does this rule relate to cops?

#parameter_rule?

Does this rule relate to parameters?

#violated?, #config

Instance Method Summary

Rule - Inherited

Instance Attribute Details

#cop_rule?Boolean (readonly)

[ GitHub ]

  
# File 'lib/rubocop/config_obsoletion/cop_rule.rb', line 15

def cop_rule?
  true
end

#old_name (readonly)

[ GitHub ]

  
# File 'lib/rubocop/config_obsoletion/cop_rule.rb', line 8

attr_reader :old_name

#violated?Boolean (readonly)

[ GitHub ]

  
# File 'lib/rubocop/config_obsoletion/cop_rule.rb', line 28

def violated?
  config.key?(old_name) || config.key?(Cop::Badge.parse(old_name).cop_name)
end

#warning?Boolean (readonly)

Cop rules currently can only be failures, not warnings

[ GitHub ]

  
# File 'lib/rubocop/config_obsoletion/cop_rule.rb', line 24

def warning?
  false
end

Instance Method Details

#message

[ GitHub ]

  
# File 'lib/rubocop/config_obsoletion/cop_rule.rb', line 19

def message
  rule_message + "\n(obsolete configuration found in #{smart_loaded_path}, please update it)"
end