Sha256: 4576131b73fed5748767adbbf2bd348aacaaeb4df7ce0a713783b9e5552ebc02

Contents?: true

Size: 511 Bytes

Versions: 7

Compression:

Stored size: 511 Bytes

Contents

# encoding: utf-8

module Rubocop
  module Cop
    module Lint
      # This cop checks for useless `else` in `begin..end` without `rescue`.
      #
      # @example
      #   begin
      #     do_something
      #   else
      #     handle_errors # This will never be run.
      #   end
      class UselessElseWithoutRescue < Cop
        include ParserDiagnostic

        private

        def relevant_diagnostic?(diagnostic)
          diagnostic.reason == :useless_else
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rubocop-0.20.1 lib/rubocop/cop/lint/useless_else_without_rescue.rb
rubocop-0.20.0 lib/rubocop/cop/lint/useless_else_without_rescue.rb
rubocop-0.19.1 lib/rubocop/cop/lint/useless_else_without_rescue.rb
rubocop-0.19.0 lib/rubocop/cop/lint/useless_else_without_rescue.rb
rubocop-0.18.1 lib/rubocop/cop/lint/useless_else_without_rescue.rb
rubocop-0.18.0 lib/rubocop/cop/lint/useless_else_without_rescue.rb
rubocop-0.17.0 lib/rubocop/cop/lint/useless_else_without_rescue.rb