Skip to content

Commit 4fc1170

Browse files
committed
feat: Support body from fmt command
1 parent f0d952d commit 4fc1170

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

terraform/parser.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func (p *DefaultParser) Parse(body string) ParseResult {
9090
func (p *FmtParser) Parse(body string) ParseResult {
9191
result := ParseResult{}
9292
if p.Fail.MatchString(body) {
93-
result.Result = "There is diff in your .tf file (need to be formatted)"
93+
result.Result = body
9494
result.ExitCode = ExitFail
9595
}
9696
return result

terraform/template.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,10 @@ const (
3939
DefaultFmtTemplate = `
4040
{{ .Title }}
4141
42-
{{ .Message }}
43-
44-
{{ .Result }}
42+
<details><summary>Details (Click me)</summary>
4543
46-
{{ .Body }}
44+
<pre><code>{{ .Body }}
45+
</pre></code></details>
4746
`
4847

4948
// DefaultPlanTemplate is a default template for terraform plan

0 commit comments

Comments
 (0)