hashicorp / hcl2

Former temporary home for experimental new version of HCL
https://github.com/hashicorp/hcl
Mozilla Public License 2.0
375 stars 64 forks source link

Support gohcl.Encode for hcl.Attributes tagged with 'hcl:",remain"' #112

Closed hmalphettes closed 5 years ago

hmalphettes commented 5 years ago

I noticed that gohcl is ignoring the content of a terraform locals block. This patch prints the locals block with its set of arbitrary named expressions.

Let me know if this is something you would plan to support here or if I should refactor this on its own. Happy to refactor it and beef it up or even attempt to complete the work to support "hcl:'remain'" for an hcl.Body with your guidance.

codecov-io commented 5 years ago

Codecov Report

Merging #112 into master will increase coverage by 0.06%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #112      +/-   ##
==========================================
+ Coverage   68.69%   68.76%   +0.06%     
==========================================
  Files          98       98              
  Lines       10299    10311      +12     
==========================================
+ Hits         7075     7090      +15     
+ Misses       2897     2895       -2     
+ Partials      327      326       -1
Impacted Files Coverage Δ
gohcl/encode.go 75.22% <100%> (+5.84%) :arrow_up:
gohcl/schema.go 88.11% <100%> (+0.11%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 318e80e...f5bd64c. Read the comment docs.

hmalphettes commented 5 years ago

Well, I did some real life testing with this patch and with regard to being able to encode the attributes of a locals block, I am facing the fact that most of the expressions are not encoded by this API at the moment. So this change by itself is not looking useful at this point.

hashibot commented 5 years ago

Hello! :robot:

Thank you for working on this change proposal.

Further development of HCL 2 will now be done in the main HCL repository. For reasons of compatibility with existing Go callers still using GOPATH mode, the master branch still tracks HCL 1 at this time, but we'll be continuing development of HCL 2 in a branch. For more information, please see the Version Selection wiki page.

Unfortunately, we can't robustly perform an automatic migration of pull requests into the new repository, and so my human friends have asked me to close out all of the existing PRs to reflect that sadly they cannot be merged in their current state. :confounded:

If you have the time and motivation, we'd love to continue discussion of this and the other existing proposed changes in the hashicorp/hcl repository in a new PR targeting the hcl2 branch. We're sorry that we weren't able to merge this prior to the transfer, and now cannot automatically migrate your PR to the new repository.

The hashicorp/hcl2 repository will soon be archived to reflect the fact that no new development is planned here. The repository will remain in place for the time being so that existing callers can continue to use it while they plan a migration to the new import paths and to a stable release of HCL 2.