Skip to content

Contributing

Development setup

Prerequisites

Build

git clone https://github.com/jtieri/mold.git
cd mold
make build    # Output: bin/mold

Test

make test     # go test -race -cover ./...

Full check

make check    # fmt + vet + lint + test

Project structure

cmd/mold/           # CLI entry point
internal/
  cli/              # Cobra command definitions
  config/           # Global config (~/.config/mold/config.toml)
  doctor/           # Health check logic
  kit/              # Kit interface and registry
  scaffold/         # Template rendering engine
  tui/              # Interactive TUI wizard
templates/          # Embedded template files

Development commands

Command Description
make build Build binary to bin/mold
make test Run tests with race detection and coverage
make lint Run golangci-lint
make fmt Format with gofmt and goimports
make vet Run go vet
make check Run fmt + vet + lint + test
make install Install to $GOPATH/bin
make docs-serve Serve documentation locally
make docs-build Build documentation site

How to contribute

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Make your changes
  4. Run make check to verify everything passes
  5. Commit and push
  6. Open a pull request

Architecture notes

  • Functional options pattern -- scaffold.Run() uses With*() options for configuration
  • Kit registry -- kits register themselves via kit.Register(). Use kit.Get() and kit.List() to access them
  • Embedded templates -- all template files are embedded using Go's embed.FS, so the binary has no runtime dependencies
  • Template rendering -- uses Go's text/template with a TemplateData struct containing project metadata