Class: RuboCop::Cop::Chef::ChefDeprecations::AttributeMetadata
- Inherits:
-
RuboCop::Cop
- Object
- RuboCop::Cop
- RuboCop::Cop::Chef::ChefDeprecations::AttributeMetadata
- Defined in:
- lib/rubocop/cop/chef/deprecation/attribute_metadata.rb
Overview
Don’t use the deprecated ‘attribute’ metadata value
Constant Summary collapse
- MSG =
"Don't use the deprecated 'attribute' metadata value".freeze
Instance Method Summary collapse
Instance Method Details
#autocorrect(node) ⇒ Object
42 43 44 45 46 |
# File 'lib/rubocop/cop/chef/deprecation/attribute_metadata.rb', line 42 def autocorrect(node) lambda do |corrector| corrector.remove(node.loc.expression) end end |
#on_send(node) ⇒ Object
38 39 40 |
# File 'lib/rubocop/cop/chef/deprecation/attribute_metadata.rb', line 38 def on_send(node) add_offense(node, location: :expression, message: MSG, severity: :refactor) if node.method_name == :attribute end |