Skip to content

Commit ec2b4a2

Browse files
authored
tflint: Add workaround for parsing heredoc expressions (#93)
1 parent d98be73 commit ec2b4a2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tflint/client/decode.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ func decodeBlock(block *Block) (*hcl.Block, hcl.Diagnostics) {
6464

6565
func parseExpression(src []byte, filename string, start hcl.Pos) (hcl.Expression, hcl.Diagnostics) {
6666
if strings.HasSuffix(filename, ".tf") {
67+
// HACK: Always add a newline to avoid heredoc parse errors.
68+
// @see https://github.com/hashicorp/hcl/issues/441
69+
src = []byte(string(src) + "\n")
6770
return hclsyntax.ParseExpression(src, filename, start)
6871
}
6972

0 commit comments

Comments
 (0)