Class: RuboCop::Cop::Chef::Deprecations::EpicFail

Inherits:
Base
  • Object
show all
Extended by:
AutoCorrector
Defined in:
lib/rubocop/cop/chef/deprecation/epic_fail.rb

Overview

Use ‘ignore_failure` in resources to continue when failures occur instead of the deprecated `epic_fail` property.

Examples:


### incorrect
package "foo" do
  epic_fail true
end

### correct
package "foo" do
  ignore_failure true
end

Constant Summary collapse

MSG =
'Use `ignore_failure` in resources to continue when failures occur instead of the deprecated `epic_fail` property'
RESTRICT_ON_SEND =
[:epic_fail].freeze

Instance Method Summary collapse

Methods inherited from Base

#target_chef_version

Instance Method Details

#on_send(node) ⇒ Object



42
43
44
45
46
# File 'lib/rubocop/cop/chef/deprecation/epic_fail.rb', line 42

def on_send(node)
  add_offense(node, severity: :warning) do |corrector|
    corrector.replace(node, 'ignore_failure true')
  end
end