class RuboCop::Cop::Chef::Sharing::IncludeResourceDescriptions

Resources should include description fields to allow automated documentation. Requires Chef Infra Client 13.9 or later.

@example

#### correct
resource_name :foo
description "The foo resource is used to do..."

Constants

MSG

Public Instance Methods

on_new_investigation() click to toggle source
# File lib/rubocop/cop/chef/sharing/include_resource_descriptions.rb, line 38
def on_new_investigation
  return if processed_source.blank? || resource_description(processed_source.ast).any?

  # Using range similar to RuboCop::Cop::Naming::Filename (file_name.rb)
  range = source_range(processed_source.buffer, 1, 0)

  add_offense(range, message: MSG, severity: :refactor)
end