Contributing
Development Setup
Section titled “Development Setup”Requirements: Go 1.26+, GOEXPERIMENT=jsonv2
git clone https://github.com/LarsArtmann/clean-wizard.gitcd clean-wizardnix develop # Sets GOEXPERIMENT automaticallyIf not using Nix:
export GOEXPERIMENT=jsonv2go mod downloadBuilding
Section titled “Building”go build -o clean-wizard ./cmd/clean-wizard/Testing
Section titled “Testing”# Run all testsgo test ./...
# With race detectorgo test -race ./...
# Short tests only (skip real-system tests)go test ./... -short
# BDD scenariosgo test ./tests/bdd/...
# Coverage reportgo test -cover ./...
# Benchmarksgo test -bench=. ./...Linting
Section titled “Linting”golangci-lint run ./...Adding a New Cleaner
Section titled “Adding a New Cleaner”- 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}- Register in the factory (
internal/cleaner/registry_factory.go):
registry.Register("mycleaner", NewMyCleaner(verbose, dryRun))-
Add domain enums if needed (
internal/domain/) -
Write tests — unit tests, and ideally a Ginkgo BDD test in
tests/bdd/ -
Update configuration schema if the cleaner has settings
Pull Requests
Section titled “Pull Requests”- Fork and clone the repository
- Create a feature branch (
git switch -c feature/new-cleaner) - Run tests (
go test -race ./...) - Ensure linting passes (
golangci-lint run ./...) - Open a pull request with a clear description
Code Style
Section titled “Code Style”- Strong types over runtime checks
- Early returns over nested conditionals
Result[T]for error handling in cleaner methodst.Parallel()on most testst.TempDir()for filesystem isolation in tests- Full words for variable names (no abbreviations)