You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support full reconstruction of HCL from output dictionary (#177)
* Initial commit of a "reverse transformer" to turn HCL2 dicts into Lark trees
* Add tests for the reverse reconstructor
* Add different handling to the reverse reconstructor depending on data type
* Add support for multiple block labels
* Fix accidentally escaping quotes within interpolated strings
* Properly handle escapes within HCL strings (closes#171)
* Standardize string output from transformer within nested structures to match Terraform syntax instead of Python (fixes#172)
* Fix block labels and booleans during reconstruction
* Better handle nested interpolation (fixes#173)
* Begin refactor of whitespace handling (more to come)
* overhaul of whitespace handling, remove old logic.
* Fix Pylint warnings
* Fix a few formatting issues in reconstruction
* Add a "builder" class for constructing HCL files from Python
* Update the docs for reconstruction
* fix suggested by Nfsaavedra
#177 (comment)
* a bit of refactoring
* update interpolation test case to include long non-interpolated substring
---------
Co-authored-by: Kamil Kozik <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,11 +44,11 @@ with open('foo.tf', 'r') as file:
44
44
45
45
### Parse Tree to HCL2 reconstruction
46
46
47
-
With version 5.0.0 the possibility of HCL2 reconstruction from Lark Parse Tree was introduced.
47
+
With version 5.x the possibility of HCL2 reconstruction from the Lark Parse Tree and Python dictionaries directly was introduced.
48
48
49
-
Example of manipulating Lark Parse Tree and reconstructing it back into valid HCL2 can be found in [tree-to-hcl2-reconstruction.md](https://github.com/amplify-education/python-hcl2/blob/main/tree-to-hcl2-reconstruction.md) file.
49
+
Documentation and an example of manipulating Lark Parse Tree and reconstructing it back into valid HCL2 can be found in [tree-to-hcl2-reconstruction.md](https://github.com/amplify-education/python-hcl2/blob/main/tree-to-hcl2-reconstruction.md) file.
50
50
51
-
More details about reconstruction implementation can be found in this [PR](https://github.com/amplify-education/python-hcl2/pull/169).
51
+
More details about reconstruction implementation can be found in PRs #169 and #177.
0 commit comments