Class: RuboCop::Cop::Chef::RedundantCode::SuggestsMetadata

Inherits:
Base
  • Object
show all
Extended by:
AutoCorrector
Includes:
RangeHelp
Defined in:
lib/rubocop/cop/chef/redundant/suggests_metadata.rb

Overview

The suggests metadata.rb method is not used and is unnecessary in cookbooks.

Examples:


### incorrect in metadata.rb:

suggests "another_cookbook"

Constant Summary collapse

MSG =
'The suggests metadata.rb method is not used and is unnecessary in cookbooks.'
RESTRICT_ON_SEND =
[:suggests].freeze

Instance Method Summary collapse

Methods inherited from Base

#target_chef_version

Instance Method Details

#on_send(node) ⇒ Object



37
38
39
40
41
# File 'lib/rubocop/cop/chef/redundant/suggests_metadata.rb', line 37

def on_send(node)
  add_offense(node, severity: :refactor) do |corrector|
    corrector.remove(range_with_surrounding_space(range: node.loc.expression, side: :left))
  end
end