Class: RuboCop::Cop::Chef::Deprecations::FoodcriticFile

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

Overview

The Foodcritic cookbook linter has been deprecated and should no longer be used for validating cookbooks. Do not include the .foodcritic config file used by Foodcritic in your cookbooks.

Constant Summary collapse

MSG =
'Do not include the `.foodcritic` config file for the deprecated Foodcritic cookbook linter.'

Instance Method Summary collapse

Methods inherited from Base

#target_chef_version

Instance Method Details

#on_new_investigationObject



29
30
31
32
33
34
35
36
# File 'lib/rubocop/cop/chef/deprecation/foodcritic_file.rb', line 29

def on_new_investigation
  return unless processed_source.path.end_with?('.foodcritic')

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

  add_offense(range, severity: :warning)
end