Skip to content

Files

Latest commit

 

History

History
53 lines (41 loc) · 602 Bytes

Layout-ClosingHeredocIndentation.md

File metadata and controls

53 lines (41 loc) · 602 Bytes

Pattern: Malformed closing heredoc indentation

Issue: -

Description

Checks the indentation of here document closings.

Examples

# bad
class Foo
  def bar
    <<~SQL
      'Hi'
  SQL
  end
end

# good
class Foo
  def bar
    <<~SQL
      'Hi'
    SQL
  end
end

# bad

# heredoc contents is before closing heredoc.
foo arg,
    <<~EOS
  Hi
    EOS

# good
foo arg,
    <<~EOS
  Hi
EOS

# good
foo arg,
    <<~EOS
      Hi
    EOS

Further Reading