Skip to main content

Contributing

Thank you for your interest in contributing to event-spec!

Development setup

Prerequisites

ToolVersionPurpose
Go1.26+Core runtime and CLI
golangci-lintlatestGo linting
lefthooklatestGit hooks
Node.js18+TypeScript SDK
pnpm8+TypeScript package manager

Setup

git clone https://github.com/dejanradmanovic/event-spec.git
cd event-spec

# Download Go dependencies and install dev tools (golangci-lint, lefthook, pnpm + TypeScript deps)
go mod download
make install-tools

# Install git hooks
make hooks

Makefile targets

TargetDescription
make buildCompile the CLI binary
make testRun all Go tests
make test-coverRun tests with HTML coverage report
make lintRun golangci-lint
make fmtFormat Go source files
make vetRun go vet
make tidyTidy and verify Go modules

Git hooks (lefthook)

  • pre-commit — runs go fmt and go vet on staged files
  • pre-push — runs the full test suite and linter

If a hook blocks you unexpectedly, investigate the root cause rather than bypassing with --no-verify.

Code conventions

  • Follow standard Go idioms (the linter enforces most of this)
  • No comments explaining what the code does — only why when it's non-obvious
  • No error handling for impossible cases — trust internal invariants
  • Tests should use testutil.CaptureProvider for integration tests, not mocks

Pull request process

  1. Fork the repository and create a branch from main
  2. Write tests for any new functionality
  3. Ensure make test && make lint passes
  4. Open a PR with a clear description of what changed and why

Areas to contribute

  • New providers — See Adding Providers
  • New SDK languages — See Adding SDKs
  • Hook implementationshooks/logging and hooks/otel are planned but not implemented
  • Documentation — improvements to this site are always welcome

License

event-spec uses a split license model: AGPL-3.0 for the platform (CLI, registry server, codegen engine) and Apache-2.0 for the client libraries (analytics/, provider/, hooks/, sdk/). See the License page for the full breakdown and rationale.

By submitting a pull request you agree that your contribution will be licensed under whichever license applies to the directory you are contributing to. You retain copyright on your own work.