Skip to content

Contributing

Requirements: Go 1.26+, GOEXPERIMENT=jsonv2

Terminal window
git clone https://github.com/LarsArtmann/clean-wizard.git
cd clean-wizard
nix develop # Sets GOEXPERIMENT automatically

If not using Nix:

Terminal window
export GOEXPERIMENT=jsonv2
go mod download
Terminal window
go build -o clean-wizard ./cmd/clean-wizard/
Terminal window
# Run all tests
go test ./...
# With race detector
go test -race ./...
# Short tests only (skip real-system tests)
go test ./... -short
# BDD scenarios
go test ./tests/bdd/...
# Coverage report
go test -cover ./...
# Benchmarks
go test -bench=. ./...
Terminal window
golangci-lint run ./...
  1. Implement the interface in internal/cleaner/:
type MyCleaner struct {
verbose bool
dryRun bool
}
func (c *MyCleaner) Clean(ctx context.Context) result.Result[domain.CleanResult] {
// Implementation
}
func (c *MyCleaner) IsAvailable(ctx context.Context) bool {
// Check if tool is installed
}
  1. Register in the factory (internal/cleaner/registry_factory.go):
registry.Register("mycleaner", NewMyCleaner(verbose, dryRun))
  1. Add domain enums if needed (internal/domain/)

  2. Write tests — unit tests, and ideally a Ginkgo BDD test in tests/bdd/

  3. Update configuration schema if the cleaner has settings

  1. Fork and clone the repository
  2. Create a feature branch (git switch -c feature/new-cleaner)
  3. Run tests (go test -race ./...)
  4. Ensure linting passes (golangci-lint run ./...)
  5. Open a pull request with a clear description
  • Strong types over runtime checks
  • Early returns over nested conditionals
  • Result[T] for error handling in cleaner methods
  • t.Parallel() on most tests
  • t.TempDir() for filesystem isolation in tests
  • Full words for variable names (no abbreviations)