-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix heredoc parsing in parseConfig #97
Fix heredoc parsing in parseConfig #97
Conversation
This workaround works for expressions only. In the |
Sad. So the only thing is to fix it in hcl library? |
93eb9af
to
49b8284
Compare
In my understanding, there is no problem in parsing the body (doesn't need the workaround). What problems are you facing? |
I'm trying to load Config() from plugin and have something like this in terraform configs:
It causes error "Unterminated template string; No closing marker was found for the string." |
Hmm, I can't reproduce the error with the above configuration. Could you share a minimal reproduction code? |
|
Some workaround I found so far:
This will not cause any errors |
Understood. Sure, this seems to be the same problem as hashicorp/hcl#441. When transferring blocks, the inside of the brackets is sent to the plugins, so the newline is lost in the pattern where heredoc is declared in the end. To avoid this, I think it is necessary to add a newline only when the end of the block contents is heredoc, but it seems a little difficult. It may be possible to implement a workaround, but it may require changes to the essential mechanics, such as #89 |
3b4dc57
to
b7d6662
Compare
b7d6662
to
9843cc8
Compare
Added some hackish and fragile way to guess if we need to add a newline based on diagnostics output |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😢
Relates terraform-linters/tflint#1029
Workaround added in #93 should also be added to parseConfig function