actually run fmt tests and then remove debug statements
This commit is contained in:
parent
22d373c279
commit
832c0f2b2a
|
@ -87,6 +87,8 @@ func TestHelperProcess(*testing.T) {
|
||||||
switch cmd {
|
switch cmd {
|
||||||
case "console":
|
case "console":
|
||||||
os.Exit((&ConsoleCommand{Meta: commandMeta()}).Run(args))
|
os.Exit((&ConsoleCommand{Meta: commandMeta()}).Run(args))
|
||||||
|
case "fmt":
|
||||||
|
os.Exit((&FormatCommand{Meta: commandMeta()}).Run(args))
|
||||||
case "inspect":
|
case "inspect":
|
||||||
os.Exit((&InspectCommand{Meta: commandMeta()}).Run(args))
|
os.Exit((&InspectCommand{Meta: commandMeta()}).Run(args))
|
||||||
case "build":
|
case "build":
|
||||||
|
|
|
@ -151,7 +151,7 @@ func Test_fmt_pipe(t *testing.T) {
|
||||||
env []string
|
env []string
|
||||||
expected string
|
expected string
|
||||||
}{
|
}{
|
||||||
{unformattedHCL, []string{"fmt", "-"}, nil, formattedHCL + "\n"},
|
{unformattedHCL, []string{"fmt", "-"}, nil, formattedHCL},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tc := range tc {
|
for _, tc := range tc {
|
||||||
|
|
|
@ -69,9 +69,7 @@ func (f *HCL2Formatter) Format(path string) (int, hcl.Diagnostics) {
|
||||||
f.parser = hclparse.NewParser()
|
f.parser = hclparse.NewParser()
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println(fmt.Sprintf("Path is %s", path))
|
|
||||||
if path == "-" {
|
if path == "-" {
|
||||||
fmt.Println("Found right statement!!!!!")
|
|
||||||
bytesModified, diags = f.formatFile(path, diags, bytesModified)
|
bytesModified, diags = f.formatFile(path, diags, bytesModified)
|
||||||
return bytesModified, diags
|
return bytesModified, diags
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue