class RuboCop::Cop::Chef::Modernize::DslIncludeInResource
Chef
Infra Client 12.4+ includes the Chef::DSL::Recipe in the resource and provider classed by default so there is no need to include this DSL in your resources or providers.
@example
#### incorrect include Chef::DSL::Recipe include Chef::DSL::IncludeRecipe
Constants
- MSG
- RESTRICT_ON_SEND
Public Instance Methods
on_send(node)
click to toggle source
# File lib/rubocop/cop/chef/modernize/dsl_include_in_resource.rb, line 44 def on_send(node) dsl_include?(node) do add_offense(node, message: MSG, severity: :refactor) do |corrector| corrector.remove(range_with_surrounding_space(range: node.loc.expression, side: :left)) end end end