Class: RuboCop::Cop::Chef::Sharing::IncludeResourceDescriptions
- Extended by:
- TargetChefVersion
- Includes:
- RangeHelp
- Defined in:
- lib/rubocop/cop/chef/sharing/include_resource_descriptions.rb
Overview
Resources should include description fields to allow automated documentation. Requires Chef Infra Client 13.9 or later.
Constant Summary collapse
- MSG =
'Resources should include description fields to allow automated documentation. Requires Chef Infra Client 13.9 or later.'
Instance Method Summary collapse
Methods included from TargetChefVersion
minimum_target_chef_version, required_minimum_chef_version, support_target_chef_version?
Methods inherited from Base
Instance Method Details
#on_new_investigation ⇒ Object
38 39 40 41 42 43 44 45 |
# 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, severity: :refactor) end |