actually run fmt tests and then remove debug statements

This commit is contained in:
Adrien Delorme 2021-03-15 11:41:14 +01:00
parent 22d373c279
commit 832c0f2b2a
3 changed files with 3 additions and 3 deletions

View File

@ -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":

View File

@ -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 {

View File

@ -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 {