Class: RuboCop::Cop::Chef::Deprecations::DependsOnOmnibusUpdaterCookbook

Inherits:
Base
  • Object
show all
Extended by:
AutoCorrector
Includes:
RangeHelp
Defined in:
lib/rubocop/cop/chef/deprecation/depends_omnibus_updater_cookbook.rb

Overview

Don’t depend on the EOL ‘omnibus_updater` cookbook. This cookbook no longer works with newer Chef Infra Client releases and has been replaced with the more reliable `chef_client_updater` cookbook.

Examples:


### incorrect
depends 'omnibus_updater'

### correct
depends 'chef_client_updater'

Constant Summary collapse

MSG =
"Don't depend on the EOL `omnibus_updater` cookbook. This cookbook no longer works with newer Chef Infra Client releases and has been replaced with the more reliable `chef_client_updater` cookbook."
RESTRICT_ON_SEND =
[:depends].freeze

Instance Method Summary collapse

Methods inherited from Base

#target_chef_version

Instance Method Details

#on_send(node) ⇒ Object



43
44
45
46
47
48
49
# File 'lib/rubocop/cop/chef/deprecation/depends_omnibus_updater_cookbook.rb', line 43

def on_send(node)
  legacy_depends?(node) do
    add_offense(node, severity: :warning) do |corrector|
      corrector.remove(range_with_surrounding_space(range: node.loc.expression, side: :left))
    end
  end
end