Skip to content

Commit

Permalink
tflint: Add workaround for parsing heredoc expressions (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
wata727 authored Jan 10, 2021
1 parent d98be73 commit ec2b4a2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tflint/client/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ func decodeBlock(block *Block) (*hcl.Block, hcl.Diagnostics) {

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

Expand Down

0 comments on commit ec2b4a2

Please sign in to comment.