Skip to content

Incorrect indentation after heredoc or multiline string that includes empty lines #159

Description

@alexjfisher

If a heredoc, (or a simple multiline string), contains a blank line, the indentation of resources that follow is removed.

eg.

class foo {
  $content = @("HERE")
  This heredoc is fine
  | HERE

  file { 'test':
    content => $content,
  }

  $content2 = @(HERE)
    So is this one
    | HERE

  file { 'test2':
    content => $content2,
  }

  $content3 = @(HERE)
    But a heredoc with a blank line in it...

    ... isn't
    (file resource below is not indented as it should be)
    | HERE

file { 'test3':
  content => $content3,
}
}

and

class foo {
  $str = 'foo

  bar'

# multiline string with blank line also causes following lines to be incorrectly indented.
notify { 'test':
  message => $str,
}
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions