Class: RuboCop::Cop::Chef::Correctness::MetadataMissingVersion
- Extended by:
- AutoCorrector
- Includes:
- RangeHelp
- Defined in:
- lib/rubocop/cop/chef/correctness/metadata_missing_version.rb
Overview
metadata.rb should define a version for the cookbook.
Constant Summary collapse
- MSG =
'metadata.rb should define a version for the cookbook.'
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#on_new_investigation ⇒ Object
38 39 40 41 42 43 44 45 46 |
# File 'lib/rubocop/cop/chef/correctness/metadata_missing_version.rb', line 38 def on_new_investigation # handle an empty metdata.rb file return if processed_source.ast.nil? # Using range similar to RuboCop::Cop::Naming::Filename (file_name.rb) return if cb_version?(processed_source.ast) range = source_range(processed_source.buffer, 1, 0) add_offense(range, severity: :refactor) end |