PoC for auto-generated TOML examples from structs #2360
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Below is a summarization created by an LLM (gpt-4-0125-preview). Be mindful of hallucinations and verify accuracy.
Why
The changes introduce a new command called
tomldocwithin the Chainlink Testing Framework. This command generates TOML documentation for various configuration structs used within the framework, such as blockchain networks and Chainlink node sets. It does this by reflecting over the structs, initializing them, and then using a TOML encoder to write out documentation with comments that describe each field. This automation facilitates the creation of accurate and up-to-date configuration examples for users of the framework.What
framework/cmd/tomldoc/go.modInitializes a new Go module specifically for the
tomldoccommand. It includes dependencies necessary for the command to function, such as the TOML encoder and the testing framework itself.framework/cmd/tomldoc/go.sumContains the expected cryptographic checksums of the dependencies defined in
go.mod, ensuring the integrity of the module's dependencies.framework/cmd/tomldoc/main.goImplements the logic of the
tomldoccommand. It uses reflection to initialize the configuration structs and then encodes them to TOML, including comments that serve as documentation for each field in the struct.framework/cmd/tomldoc/toml-docs.tomlAn example output of the
tomldoccommand. It serves as a template or documentation for the TOML configuration of the Chainlink Testing Framework.framework/components/blockchain/blockchain.goAdds comments to the
Inputstruct fields. These comments are used by thetomldoccommand to generate documentation.framework/docker.goAdds comments to the
ContainerResourcesstruct fields for documentation purposes.