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

Use HCL syntax #146

Merged
merged 2 commits into from
Nov 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/terraform/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func wrapCode(text string) interface{} {
if strings.Contains(text, "```") {
return `<pre><code>` + text + `</code></pre>`
}
return htmltemplate.HTML("\n```\n" + text + "\n```\n") //nolint:gosec
return htmltemplate.HTML("\n```hcl\n" + text + "\n```\n") //nolint:gosec
}

func generateOutput(kind, template string, data map[string]interface{}, useRawOutput bool) (string, error) {
Expand Down
24 changes: 12 additions & 12 deletions pkg/terraform/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestPlanTemplateExecute(t *testing.T) {

<details><summary>Details (Click me)</summary>

` + "```" + `
` + "```hcl" + `

` + "```" + `

Expand All @@ -52,7 +52,7 @@ func TestPlanTemplateExecute(t *testing.T) {

<details><summary>Details (Click me)</summary>

` + "```" + `
` + "```hcl" + `
body
` + "```" + `

Expand All @@ -76,7 +76,7 @@ body

<details><summary>Details (Click me)</summary>

` + "```" + `
` + "```hcl" + `
body
` + "```" + `

Expand All @@ -100,7 +100,7 @@ body

<details><summary>Details (Click me)</summary>

` + "```" + `
` + "```hcl" + `
This is a "body".
` + "```" + `

Expand All @@ -125,7 +125,7 @@ This is a "body".

<details><summary>Details (Click me)</summary>

` + "```" + `
` + "```hcl" + `
This is a "body".
` + "```" + `

Expand All @@ -149,7 +149,7 @@ This is a "body".

<details><summary>Details (Click me)</summary>

` + "```" + `
` + "```hcl" + `
body
` + "```" + `

Expand Down Expand Up @@ -207,7 +207,7 @@ func TestApplyTemplateExecute(t *testing.T) {

<details><summary>Details (Click me)</summary>

` + "```" + `
` + "```hcl" + `

` + "```" + `

Expand All @@ -230,7 +230,7 @@ func TestApplyTemplateExecute(t *testing.T) {

<details><summary>Details (Click me)</summary>

` + "```" + `
` + "```hcl" + `
body
` + "```" + `

Expand All @@ -253,7 +253,7 @@ body

<details><summary>Details (Click me)</summary>

` + "```" + `
` + "```hcl" + `
body
` + "```" + `

Expand All @@ -276,7 +276,7 @@ body

<details><summary>Details (Click me)</summary>

` + "```" + `
` + "```hcl" + `
body
` + "```" + `

Expand All @@ -299,7 +299,7 @@ body

<details><summary>Details (Click me)</summary>

` + "```" + `
` + "```hcl" + `
This is a "body".
` + "```" + `

Expand All @@ -323,7 +323,7 @@ This is a "body".

<details><summary>Details (Click me)</summary>

` + "```" + `
` + "```hcl" + `
This is a "body".
` + "```" + `

Expand Down