Class: RuboCop::Cop::Chef::RedundantCode::RecipeMetadata

Inherits:
Base
  • Object
show all
Extended by:
AutoCorrector
Includes:
RangeHelp, RuboCop::Chef::AutocorrectHelpers
Defined in:
lib/rubocop/cop/chef/redundant/recipe_metadata.rb

Overview

The recipe metadata.rb method is not used and is unnecessary in cookbooks. Recipes should be documented in the cookbook’s README.md file instead.

Examples:


### incorrect
recipe 'openldap::default', 'Install and configure OpenLDAP'

Constant Summary collapse

MSG =
"The recipe metadata.rb method is not used and is unnecessary in cookbooks. Recipes should be documented in the cookbook's README.md file instead."
RESTRICT_ON_SEND =
[:recipe].freeze

Instance Method Summary collapse

Methods included from RuboCop::Chef::AutocorrectHelpers

#expression_including_heredocs

Methods inherited from Base

#target_chef_version

Instance Method Details

#on_send(node) ⇒ Object



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

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