Skip to content

Development

  • Go 1.25+
  • Make (optional, for convenience)
  • golangci-lint v2+ (for linting)
Terminal window
git clone https://github.com/nassiharel/klim.git
cd klim
make build

The binary is output to bin/klim with version/commit/date injected via ldflags.

CommandDescription
make allLint + test + build (default target)
make buildBuild bin/klim with version ldflags
make testRun tests with race detector (go test -race -count=1 ./...)
make lintRun golangci-lint
make coverGenerate HTML coverage report
make marketplace-validateValidate marketplace tool/pack YAML files
make marketplace-assembleAssemble individual files → marketplace.yaml

Tests use standard Go testing patterns:

  • Table-driven tests for systematic coverage
  • httptest.NewServer for HTTP endpoint testing
  • t.TempDir() for filesystem tests
  • In-memory archives for testing extraction
  • atomic.Pointer for pmAvailableFunc test hooks
Terminal window
# Run all tests
make test
# Run tests for a specific package
go test ./internal/catalog/...
# Run with verbose output
go test -v ./internal/pkgmgr/...

An opt-in integration test suite live-checks every marketplace package ID against real package managers:

Terminal window
# Runs against whatever PMs are on your PATH
go test -tags=integration -timeout=40m ./internal/marketplace/livecheck/...

This is also run weekly in CI across Linux/macOS/Windows runners.

Terminal window
make lint
# or directly
golangci-lint run

CI enforces gofmt, go vet, and golangci-lint on every PR.

WorkflowTriggerWhat it does
ci.ymlpush/PRLint, test (Linux/macOS/Windows matrix), govulncheck
marketplace.ymlpush/PR (marketplace/**)Validate, assemble, publish catalog
marketplace-livecheck.ymlWeekly/manualLive-check package IDs across all PMs
release.ymlv* tagGoReleaser → release, Homebrew tap, deb/rpm, SBOM
codeql.ymlpush/weeklySecurity analysis

See the Architecture page for the full module layout and data flow.