From 4fc11707df04531d6675df2fcc657dc5315fb1d7 Mon Sep 17 00:00:00 2001 From: Alberto Rojas Date: Wed, 7 Dec 2022 13:04:10 -0700 Subject: [PATCH] feat: Support body from fmt command --- terraform/parser.go | 2 +- terraform/template.go | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/terraform/parser.go b/terraform/parser.go index 938afc4..9dace47 100644 --- a/terraform/parser.go +++ b/terraform/parser.go @@ -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 diff --git a/terraform/template.go b/terraform/template.go index 0126acb..5387471 100644 --- a/terraform/template.go +++ b/terraform/template.go @@ -39,11 +39,10 @@ const ( DefaultFmtTemplate = ` {{ .Title }} -{{ .Message }} - -{{ .Result }} +
Details (Click me) -{{ .Body }} +
{{ .Body }}
+
` // DefaultPlanTemplate is a default template for terraform plan