Class: RuboCop::Cop::Chef::ChefDeprecations::LongDescriptionMetadata

Inherits:
RuboCop::Cop
  • Object
show all
Includes:
RangeHelp
Defined in:
lib/rubocop/cop/chef/deprecation/long_description_metadata.rb

Overview

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

Examples:


# bad
long_description 'this is my cookbook and this description will never be seen'

Constant Summary collapse

MSG =
'The long_description metadata.rb method is not used and is unnecessary in cookbooks'.freeze

Instance Method Summary collapse

Instance Method Details

#autocorrect(node) ⇒ Object



39
40
41
42
43
# File 'lib/rubocop/cop/chef/deprecation/long_description_metadata.rb', line 39

def autocorrect(node)
  lambda do |corrector|
    corrector.remove(range_with_surrounding_space(range: node.loc.expression, side: :right))
  end
end

#on_send(node) ⇒ Object



35
36
37
# File 'lib/rubocop/cop/chef/deprecation/long_description_metadata.rb', line 35

def on_send(node)
  add_offense(node, location: :expression, message: MSG, severity: :refactor) if node.method_name == :long_description
end