class RuboCop::Cop::Chef::RedundantCode::ResourceWithNothingAction

Chef Infra Client provides the :nothing action by default for every resource. There is no need to define a :nothing action in your resource code.

@example

#### incorrect
action :nothing
  # let's do nothing
end

Constants

MSG

Public Instance Methods

on_block(node) click to toggle source
# File lib/rubocop/cop/chef/redundant/resource_with_nothing_action.rb, line 41
def on_block(node)
  nothing_action?(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