Skip to content

Files

Latest commit

 

History

History
34 lines (25 loc) · 482 Bytes

Lint-UselessElseWithoutRescue.md

File metadata and controls

34 lines (25 loc) · 482 Bytes

Pattern: Useless else in begin..end

Issue: -

Description

This rule checks for useless else in begin..end without rescue.

Examples

# bad

begin
  do_something
else
  do_something_else # This will never be run.
end
# good

begin
  do_something
rescue
  handle_errors
else
  do_something_else
end

Further Reading