Skip to content

Commit

Permalink
feat: improve list formatting (#355)
Browse files Browse the repository at this point in the history
  • Loading branch information
katcipis committed Jun 1, 2022
1 parent 9fd3f27 commit e9db5c8
Show file tree
Hide file tree
Showing 20 changed files with 1,354 additions and 15 deletions.
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,16 @@ test:
test/ci: build
./bin/terramate list --changed

## start fuzzying to generate some new corpus/find errors
.PHONY: test/fuzz
test/fuzz:
## start fuzzying to generate some new corpus/find errors on partial eval
.PHONY: test/fuzz/eval
test/fuzz/eval:
go test ./hcl/eval -fuzz=FuzzPartialEval

## start fuzzying to generate some new corpus/find errors on formatting
.PHONY: test/fuzz/fmt
test/fuzz/fmt:
go test ./hcl -fuzz=FuzzFormatMultiline

## Build terramate into bin directory
.PHONY: build
build:
Expand Down
2 changes: 1 addition & 1 deletion generate/genhcl/genhcl.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func Load(rootdir string, sm stack.Metadata, globals stack.Globals) (StackHCLs,
"failed to generate block %q", name,
)
}
formatted, err := hcl.Format(string(gen.Bytes()), loadedHCL.origin)
formatted, err := hcl.FormatMultiline(string(gen.Bytes()), loadedHCL.origin)
if err != nil {
return StackHCLs{}, errors.E(sm, err,
"failed to format generated code for block %q", name,
Expand Down

0 comments on commit e9db5c8

Please sign in to comment.