Skip to content

New cop for surrounding multiline code blocks by empty lines #961

@fatkodima

Description

@fatkodima
# bad

def foo
  x = 1
  y = 1
  if bar
    zoo
    quux
  end
  false
end

# good

def foo
  x = 1
  y = 1

  if bar # <--- multiline, should be separated by a blank line from its neighbors
    zoo
    quux
  end

  false
end

These extra spaces adds breathing room and makes code easier to read.
I am going to implement this in my app as a custom cop. If this is welcome in core, let me know.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions