actually run fmt tests and then remove debug statements

pull/10457/head
Adrien Delorme 5 years ago
parent 22d373c279
commit 832c0f2b2a

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

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

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

Loading…
Cancel
Save