Class: RuboCop::Cop::Chef::AttributeMetadata
- Inherits:
-
RuboCop::Cop
- Object
- RuboCop::Cop
- RuboCop::Cop::Chef::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
41 42 43 44 45 |
# File 'lib/rubocop/cop/chef/deprecation/attribute_metadata.rb', line 41 def autocorrect(node) lambda do |corrector| corrector.remove(node.loc.expression) end end |
#on_send(node) ⇒ Object
37 38 39 |
# File 'lib/rubocop/cop/chef/deprecation/attribute_metadata.rb', line 37 def on_send(node) add_offense(node, location: :expression, message: MSG, severity: :refactor) if node.method_name == :attribute end |