Class: RuboCop::Cop::Chef::Deprecations::ResourceUsesProviderBaseMethod

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

Overview

The Resource.provider_base allows the developer to specify within a resource a module to load the resource’s provider from. Instead, the provider should call provides to register itself, or the resource should call provider to specify the provider to use.

Examples:


### incorrect
provider_base ::Chef::Provider::SomethingSomething

Constant Summary collapse

MSG =
"Don't use the deprecated provider_base method in a resource to specify the provider module to use. Instead, the provider should call provides to register itself, or the resource should call provider to specify the provider to use. This will cause failures in Chef Infra Client 13 and later."
RESTRICT_ON_SEND =
[:provider_base].freeze

Instance Method Summary collapse

Methods inherited from Base

#target_chef_version

Instance Method Details

#on_send(node) ⇒ Object



33
34
35
# File 'lib/rubocop/cop/chef/deprecation/resource_uses_provider_base_method.rb', line 33

def on_send(node)
  add_offense(node, severity: :warning)
end