Skip to content

Files

Latest commit

 

History

History
39 lines (30 loc) · 585 Bytes

Layout-ElseAlignment.md

File metadata and controls

39 lines (30 loc) · 585 Bytes

Pattern: Misaligned else

Issue: -

Description

This rule checks the alignment of else keywords. Normally they should be aligned with an if/unless/while/until/begin/def keyword, but there are special cases when they should follow the same rules as the alignment of end.

Examples

# bad
if something
  code
 else
  code
end

# bad
if something
  code
 elsif something
  code
end

# good
if something
  code
else
  code
end

Further Reading