Skip to content

Commit

Permalink
feat: Support body from fmt command
Browse files Browse the repository at this point in the history
  • Loading branch information
albertorm95 committed Dec 7, 2022
1 parent f0d952d commit 4fc1170
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion terraform/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (p *DefaultParser) Parse(body string) ParseResult {
func (p *FmtParser) Parse(body string) ParseResult {
result := ParseResult{}
if p.Fail.MatchString(body) {
result.Result = "There is diff in your .tf file (need to be formatted)"
result.Result = body
result.ExitCode = ExitFail
}
return result
Expand Down
7 changes: 3 additions & 4 deletions terraform/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@ const (
DefaultFmtTemplate = `
{{ .Title }}
{{ .Message }}
{{ .Result }}
<details><summary>Details (Click me)</summary>
{{ .Body }}
<pre><code>{{ .Body }}
</pre></code></details>
`

// DefaultPlanTemplate is a default template for terraform plan
Expand Down

0 comments on commit 4fc1170

Please sign in to comment.