class RuboCop::Cop::Chef::Deprecations::IncludingYumDNFCompatRecipe

Don't include the deprecated yum DNF compatibility recipe, which is no longer necessary as Chef Infra Client includes DNF package support

@example

#### incorrect
include_recipe 'yum::dnf_yum_compat'

Constants

MSG
RESTRICT_ON_SEND

Public Instance Methods

on_send(node) click to toggle source
# File lib/rubocop/cop/chef/deprecation/yum_dnf_compat_recipe.rb, line 41
def on_send(node)
  yum_dnf_compat_recipe_usage?(node) do
    node = node.parent if node.parent&.conditional? && node.parent&.single_line?
    add_offense(node, message: MSG, severity: :warning) do |corrector|
      corrector.remove(range_with_surrounding_space(range: node.loc.expression, side: :left))
    end
  end
end