From 832c0f2b2a36da65d837f66e752c9534a12c971e Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Mon, 15 Mar 2021 11:41:14 +0100 Subject: [PATCH] actually run fmt tests and then remove debug statements --- command/exec_test.go | 2 ++ command/fmt_test.go | 2 +- hcl2template/formatter.go | 2 -- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/command/exec_test.go b/command/exec_test.go index fdad36c26..4986a4bf3 100644 --- a/command/exec_test.go +++ b/command/exec_test.go @@ -87,6 +87,8 @@ func TestHelperProcess(*testing.T) { switch cmd { case "console": os.Exit((&ConsoleCommand{Meta: commandMeta()}).Run(args)) + case "fmt": + os.Exit((&FormatCommand{Meta: commandMeta()}).Run(args)) case "inspect": os.Exit((&InspectCommand{Meta: commandMeta()}).Run(args)) case "build": diff --git a/command/fmt_test.go b/command/fmt_test.go index fe539490b..e7011dba9 100644 --- a/command/fmt_test.go +++ b/command/fmt_test.go @@ -151,7 +151,7 @@ func Test_fmt_pipe(t *testing.T) { env []string expected string }{ - {unformattedHCL, []string{"fmt", "-"}, nil, formattedHCL + "\n"}, + {unformattedHCL, []string{"fmt", "-"}, nil, formattedHCL}, } for _, tc := range tc { diff --git a/hcl2template/formatter.go b/hcl2template/formatter.go index 286d1b1e5..7f0f65a98 100644 --- a/hcl2template/formatter.go +++ b/hcl2template/formatter.go @@ -69,9 +69,7 @@ func (f *HCL2Formatter) Format(path string) (int, hcl.Diagnostics) { f.parser = hclparse.NewParser() } - fmt.Println(fmt.Sprintf("Path is %s", path)) if path == "-" { - fmt.Println("Found right statement!!!!!") bytesModified, diags = f.formatFile(path, diags, bytesModified) return bytesModified, diags } else {