Sha256: 0bba5dd22ec7cd76fcf998b73097d773b2861d5b1c0d5f3049b241ec5e292e3e

Contents?: true

Size: 352 Bytes

Versions: 2

Compression:

Stored size: 352 Bytes

Contents

# encoding: utf-8

module Rubocop
  module Cop
    module Lint
      # This cop checks for empty `ensure` blocks
      class EmptyEnsure < Cop
        MSG = 'Empty ensure block detected.'

        def on_ensure(node)
          _body, ensure_body = *node

          add_offense(node, :keyword) unless ensure_body
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rubocop-0.19.1 lib/rubocop/cop/lint/empty_ensure.rb
rubocop-0.19.0 lib/rubocop/cop/lint/empty_ensure.rb