Thayne McCombs

Results 594 comments of Thayne McCombs

Commit f259aea700a94b7365d3f6ed6e99619be44331df partially solves this problem. You can now replace your with-context hack with ``` (restas:with-module 'sm1 (mod1:add-var 1)) ``` With this it would be straightforward to implement the cdefun...

I believe this is hitting a known limitation of hcl2json. From the README: > Note, however, that there are some corner cases where it may not be exactly equivalent, especially...

One way this could be solved is for hcl2json to support the same spec format as hcldec. See https://github.com/hashicorp/hcl/blob/main/cmd/hcldec/spec-format.md

hmmm, what would you expect the output json to look like? This feature may be out of scope for this project. Are you doing the static analysis with go, or...

Basically the way it works is [`ConvertFile`](https://github.com/tmccombs/hcl2json/blob/7220684b0cdc7dca4e5acdb228960fab091ec9bb/convert/convert.go#L57) Recursively walks through the AST of an [`hclsyntax.Body`](https://pkg.go.dev/github.com/hashicorp/hcl/[email protected]/hclsyntax#Body), and each part of the AST has one or more "Range" properties that describe the...

That seems reasonable. My big question is how does it decide if it should use a set/array or not? Should it always wrap objects in arrays, or have a list...

I'd rather have something more general, because currently this tool could be used for more than just terraform, and even in the context of terraform, this same issue could arise...

I'm not sure I really understand what you are trying to do. Are you wanting to add tests to this project, or use this tool to run tests in another...

I believe this is a side-effect of https://github.com/tmccombs/hcl2json/commit/c269182a1356d3e85b1f6b64250c8a4a77cc6364. What kind of problems is this change causing?

See https://github.com/tmccombs/hcl2json/issues/18 Basically, we can't both be consistent about whether a block produces an object or an array of objects and use a single object if there is only one....