Class: RuboCop::Cop::Chef::ChefModernize::UnnecessaryDependsChef14
- Inherits:
-
RuboCop::Cop
- Object
- RuboCop::Cop
- RuboCop::Cop::Chef::ChefModernize::UnnecessaryDependsChef14
- Defined in:
- lib/rubocop/cop/chef/modernize/chef_14_resources.rb
Overview
Don’t depend on cookbooks made obsolete by Chef Infra Client 14+. These community cookbooks contain resources that are now included in Chef Infra Client itself.
Constant Summary collapse
- MSG =
"Don't depend on cookbooks made obsolete by Chef Infra Client 14+. These community cookbooks contain resources that are now included in Chef Infra Client itself.".freeze
Instance Method Summary collapse
Instance Method Details
#autocorrect(node) ⇒ Object
47 48 49 50 51 |
# File 'lib/rubocop/cop/chef/modernize/chef_14_resources.rb', line 47 def autocorrect(node) lambda do |corrector| corrector.remove(node.loc.expression) end end |
#on_send(node) ⇒ Object
41 42 43 44 45 |
# File 'lib/rubocop/cop/chef/modernize/chef_14_resources.rb', line 41 def on_send(node) legacy_depends?(node) do add_offense(node, location: :expression, message: MSG, severity: :refactor) end end |