Contributing¶
Development setup¶
git clone https://github.com/trep-dev/trep
cd trep
go build ./... # verify it compiles
go test ./... # run the test suite
Requires Go 1.21+. No other tools are needed for core development; dependencies are vendored.
Running tests¶
make test # run all tests
make test-race # run with race detector (recommended before pushing)
make test-cover # generate a coverage report to coverage.out
Generating reports locally¶
To generate test and coverage HTML reports using trep itself:
Building the docs site¶
Requires Python and MkDocs Material:
pip install -r requirements.txt
make docs # build the site → site/
make serve-docs # build and serve at http://localhost:8000
Adding a new test input format¶
- Create
pkg/parser/<name>/parser.goimplementingparser.Parser. - Register it via
func init() { parser.Register(Parser{}) }. - Add a blank import in
cmd/trep/main.go. - Write tests in
pkg/parser/<name>/parser_test.go.
Adding a new coverage format follows the same pattern under pkg/coverage/parser/.
Pull request guidelines¶
- Keep changes focused — one concern per PR.
- All tests must pass (
make test-race). - Update the relevant flags table in
README.mdif you add or change CLI flags. - Do not add new runtime dependencies without discussion.
Reporting bugs¶
Open a GitHub issue with:
- The
trepversion (trep --version). - The input file or a minimal reproducer.
- The observed and expected behaviour.