Code
This page provides an outline for developing and contributing to
hof
’s code base.
Building
make hof
will go install the clihof gen
will regenerate code from the CUE indesign/
. You only have to run this if the design changes.make formatters
will build local images.
Testing
Most tests are Testscript base, a tool from the Go compiler
for testing CLIs. It makes it easy to write and add new tests.
The test runners live in test.cue
and are run with hof flow
.
These act as top-level wrappers around the individual tests,
and the same commands are run in CI for parity with local development.
hof flow @test/<area>
will run the tests for<area>
hof flow --list @test/*
will list available tests (areas)
You can find the paths from the test.cue
file
to find where and how each set of tests are run.
Most tests are in the following directories:
test/...
lib/mod/testdata
lib/datamodel/test
flow/testdata
formatters/test
Core packages
cmd/hof/...
- the command structure, mostly generatedlib/hof
- metadata for values hof recognizeslib/runtime
- holds CUE, generators, datamodels, workflows from entrypointslib/gen
- code generation enginelib/template
- template rendering and helperslib/create
- creators implementationlib/datamodel
- datamodel engineformatters/tools
|lib/fmt
- code and containers for code formattingflow/...
- the workflow enginelib/mod
|lib/repos
- CUE dependency management