Skip to content

Latest commit

 

History

History
44 lines (32 loc) · 572 Bytes

Style-EmptyLineAfterGuardClause.md

File metadata and controls

44 lines (32 loc) · 572 Bytes

Pattern: Missing empty line after guard clause

Issue: -

Description

This rule enforces empty line after guard clause

Examples

# bad
def foo
  return if need_return?
  bar
end

# good
def foo
  return if need_return?

  bar
end

# good
def foo
  return if something?
  return if something_different?

  bar
end

# also good
def foo
  if something?
    do_something
    return if need_return?
  end
end

Further Reading