tofusoup
2025-06-06
Added HCL test, convert file, lint, and generate-random commands with enhanced Go generator
18 files · 1,703+ · 890-
New cty lint and generate-random commands
2 files changed
CTY_GENERATE_ENHANCEMENTS.mdDesign document for bi-directional testing workflow using generate and lint commands across Go and Pythongo_cty_generator.goAdded lint mode with ctyjson.UnmarshalType fallback, random value generation with seed support, and improved type parsing
- Added cty lint command design for validating values against type definitions across implementations
instantiate
architectural
1 file
CTY_GENERATE_ENHANCEMENTS.md
- Implemented generateRandomCtyValue in Go for producing valid random instances of any cty type
instantiate
behavioral
1 file
go_cty_generator.go
- Added ctyjson.UnmarshalType as fallback parser when custom type string parser fails
harden
behavioral
1 file
go_cty_generator.go
HCL test command with rich output
1 file changed
cli.pyAdded cty hcl test subcommand that parses Terraform files and displays structure as a rich tree; restructured command groups
- Implemented cty hcl test using python-hcl2 parser with rich tree output showing HCL structure
instantiate
behavioral
1 file
cli.py
- Restructured CLI into cty convert, cty generate, and cty hcl command groups
streamline
architectural
1 file
cli.py
Convert file command implementation
2 files changed
convert_logic.pyFormat conversion logic with HCL/JSON/Msgpack loaders and JSON/Msgpack dumperstest_convert_commands.pyTests for convert file including format detection, round-trips, and HCL-output not-implemented error
- Implemented file format conversion between HCL, JSON, and Msgpack via Python dict intermediate
instantiate
behavioral
1 file
convert_logic.py
Go interaction layer enhancements
1 file changed
go_interaction.pyExtended Go interaction to support lint mode and random generation flags
- Added parameters for lint mode, random generation, and seed to the Go subprocess interface
interface
behavioral
1 file
go_interaction.py
Terraform example fixtures
3 files changed
simple_for_convert.mpkMsgpack fixture for conversion testingsimple_for_hcl_view.tfHCL fixture for tree view testingsimple_resource_for_convert.tfTerraform resource for conversion testing