Skip to content
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

Backport of repl: Display multi-line strings as heredocs into v0.14 #27054

Merged

Conversation

teamterraform
Copy link
Contributor

Backport

This PR is auto-generated from #27045 to be assessed for backporting due to the inclusion of the label 0.14-backport.

The below text is copied from the body of the original PR.


The console and output formatter previously displayed multi-line strings with escaped newlines, e.g. "hello\nworld\n". While this is a valid way to write the HCL string, it is not as common or as readable as using the heredoc syntax, e.g.

<<EOF
hello
world
EOF

This commit adds heredoc detection and display to this formatter, including support for indented heredocs for nested multi-line strings. This change affects the apply, console, and output sub-commands.

Fixes #27039. Targeting an 0.14.0 backport because this is a fairly narrowly-scoped fix to a problem introduced by changes in the 0.14 release.

@alisdair alisdair requested a review from a team November 30, 2020 16:25
@alisdair alisdair self-assigned this Nov 30, 2020
@codecov
Copy link

codecov bot commented Nov 30, 2020

Codecov Report

Merging #27054 (56516bb) into v0.14 (af587cb) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted Files Coverage Δ
repl/format.go 99.05% <100.00%> (+0.29%) ⬆️
states/statefile/version4.go 58.19% <0.00%> (+0.23%) ⬆️
backend/remote/backend_common.go 52.70% <0.00%> (+0.72%) ⬆️
terraform/node_resource_apply_instance.go 75.79% <0.00%> (+0.79%) ⬆️
terraform/eval_diff.go 68.45% <0.00%> (+0.93%) ⬆️

@alisdair alisdair merged commit 7ec4cec into v0.14 Nov 30, 2020
@alisdair alisdair deleted the backport/alisdair/output-heredocs/multiply-robust-squirrel branch November 30, 2020 17:11
@ghost
Copy link

ghost commented Dec 31, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants