Class: RuboCop::Cop::Chef::Correctness::ChefApplicationFatal
- Extended by:
- AutoCorrector
- Defined in:
- lib/rubocop/cop/chef/correctness/chef_application_fatal.rb
Overview
Use ‘raise` to force Chef Infra Client to fail instead of using `Chef::Application.fatal`, which masks the full stack trace of the failure and makes debugging difficult.
Constant Summary collapse
- MSG =
'Use raise to force Chef Infra Client to fail instead of using Chef::Application.fatal'
- RESTRICT_ON_SEND =
[:fatal!].freeze
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#on_send(node) ⇒ Object
45 46 47 48 49 50 51 |
# File 'lib/rubocop/cop/chef/correctness/chef_application_fatal.rb', line 45 def on_send(node) application_fatal?(node) do |val| add_offense(node, severity: :refactor) do |corrector| corrector.replace(node, "raise(#{val.source})") end end end |