Class: RuboCop::Cop::Chef::Sharing::IncludeResourceExamples
- Extended by:
- TargetChefVersion
- Includes:
- RangeHelp
- Defined in:
- lib/rubocop/cop/chef/sharing/include_resource_examples.rb
Overview
Resources should include examples field to allow automated documentation. Requires Chef Infra Client 13.9 or later.
Constant Summary collapse
- MSG =
'Resources should include examples field 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
46 47 48 49 50 51 52 53 |
# File 'lib/rubocop/cop/chef/sharing/include_resource_examples.rb', line 46 def on_new_investigation return if processed_source.blank? || resource_examples(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 |