Class: RuboCop::Cop::Chef::Effortless::Berksfile

Inherits:
Base
  • Object
show all
Includes:
RangeHelp
Defined in:
lib/rubocop/cop/chef/effortless/berksfile.rb

Overview

Policyfiles should be used for cookbook dependency solving instead of a Berkshelf Berksfile.

Constant Summary collapse

MSG =
'Policyfiles should be used for cookbook dependency solving instead of a Berkshelf Berksfile.'

Instance Method Summary collapse

Methods inherited from Base

#target_chef_version

Instance Method Details

#on_new_investigationObject



29
30
31
32
33
34
# File 'lib/rubocop/cop/chef/effortless/berksfile.rb', line 29

def on_new_investigation
  # 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