Skip to content

Commit

Permalink
Merge pull request #146 from dtaniwaki/use-hcl-syntax
Browse files Browse the repository at this point in the history
Use HCL syntax
  • Loading branch information
suzuki-shunsuke committed Nov 20, 2021
2 parents d8ced85 + 3ec2b2e commit 38c677f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
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

0 comments on commit 38c677f

Please sign in to comment.