tofusoup
2025-05-31
Initial CLI tool with Go and Python generators for cross-language cty testing
20 files · 1,542+ · 1,183-
CLI framework and command structure
2 files changed
cli.pyClick-based CLI with build-go, generate, and convert subcommands; async subprocess runner for Go binarypyproject.tomlProject metadata and dependencies including click, msgpack, python-hcl2, pyyaml
- Established main CLI entry point with verbose/log-file options and version display
instantiate
architectural
1 file
cli.py
- Added build-go command to compile Go cty generator via build_go.sh
instantiate
behavioral
1 file
cli.py
- Added generate command supporting both Go and Python implementations with YAML input and JSON/Msgpack output
instantiate
behavioral
1 file
cli.py
Go cty value generator
1 file changed
go_cty_generator.goGo utility that parses cty type definitions, constructs cty.Values from YAML input, and serializes to JSON or Msgpack
- Implemented type definition parser supporting string, number, bool, list, set, map, tuple, and object types
instantiate
behavioral
1 file
go_cty_generator.go
- Added nested delimiter-respecting parser for complex type strings like object({name=string,age=number})
instantiate
behavioral
1 file
go_cty_generator.go
- Added emoji-based structured logging with domain/action/status prefix system
instantiate
internal
1 file
go_cty_generator.go
Python cty generator and conversion logic
4 files changed
py_cty_generator.pyPython-side cty value generation for cross-language comparisonconvert_logic.pyFile format conversion between HCL, JSON, and Msgpack using Python dictionaries as intermediate representationgo_interaction.pyAsync subprocess wrapper for invoking the Go cty generator binaryutils.pyShared utility functions including YAML spec parsing
- Implemented loaders for HCL (python-hcl2), JSON, and Msgpack formats with ConversionError handling
instantiate
behavioral
1 file
convert_logic.py
- HCL output (dump_dict_to_hcl_string) left as NotImplementedError due to python-hcl2 lacking a dumps equivalent
specify
behavioral
1 file
convert_logic.py
Test infrastructure and design documentation
4 files changed
test_cli_commands.pyCLI integration tests covering build, generate, and convert commandstest_convert_commands.pyConversion-specific tests for HCL/JSON/Msgpack round-tripstest_cty_compatibility.pyCross-language compatibility test suite comparing Go and Python cty outputsCONVERT_COMMAND_DESIGN.mdDesign doc for the convert file command with future CtyValue-centric refactor plan
- Added test cases for CLI invocation, format conversion, and error handling
qualify
behavioral
2 files
test_cli_commands.pytest_convert_commands.py
Terraform example fixtures
6 files changed
simple_for_hcl_view.tfSimple Terraform config for HCL viewing testssimple_for_convert.jsonJSON fixture for conversion testssimple_resource_for_convert.tfTerraform resource fixture for convert testscomplex_for_hcl_view.tfComplex nested Terraform config for HCL view testinginvalid_for_convert.tfInvalid Terraform file for error-path testinginvalid_for_hcl_view.tfInvalid HCL file for error-path testing