Class: Rubocop::Cop::Lint::EmptyEnsure
- Defined in:
- lib/rubocop/cop/lint/empty_ensure.rb
Overview
This cop checks for empty ensure
blocks
Constant Summary collapse
- MSG =
'Empty ensure block detected.'
Constants inherited from Cop
Instance Attribute Summary
Attributes inherited from Cop
#config, #corrections, #offences, #processed_source
Instance Method Summary collapse
Methods inherited from Cop
#add_offence, all, #autocorrect?, #autocorrect_action, #convention, #cop_config, #cop_name, cop_name, cop_type, #debug?, #ignore_node, inherited, #initialize, lint?, #message, rails?, style?, #warning
Constructor Details
This class inherits a constructor from Rubocop::Cop::Cop
Instance Method Details
#on_ensure(node) ⇒ Object
10 11 12 13 14 |
# File 'lib/rubocop/cop/lint/empty_ensure.rb', line 10 def on_ensure(node) _body, ensure_body = *node warning(node, :keyword) unless ensure_body end |