Sha256: 1114af88142716b8543fda00c795414f5d705f62c44a050cda15577e3eb3f72f
Contents?: true
Size: 885 Bytes
Versions: 1
Compression:
Stored size: 885 Bytes
Contents
# frozen_string_literal: true module RuboCop module Cop module Lint # This cop checks for useless `else` in `begin..end` without `rescue`. # # @example # # # bad # # begin # do_something # else # do_something_else # This will never be run. # end # # @example # # # good # # begin # do_something # rescue # handle_errors # else # do_something_else # end class UselessElseWithoutRescue < Cop include ParserDiagnostic MSG = '`else` without `rescue` is useless.' private def relevant_diagnostic?(diagnostic) diagnostic.reason == :useless_else end def alternative_message(_diagnostic) MSG end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rubocop-0.69.0 | lib/rubocop/cop/lint/useless_else_without_rescue.rb |