Skip to content

Contributing

Requirements: Go 1.26+

Terminal window
git clone https://github.com/LarsArtmann/gogenfilter.git
cd gogenfilter
go mod download
Terminal window
go build ./...
Terminal window
# Run all tests
go test ./...
# With race detector
go test -race ./...

Uses golangci-lint v2:

Terminal window
golangci-lint run
  • Table-driven tests where possible
  • t.Parallel() within t.Run() for test isolation
  • Functional options pattern for configuration
  • Strong types over runtime checks
  • Early returns over nested conditionals
  1. Add a FilterOption and FilterReason const with the same string value in types.go
  2. Add a detector entry in the detectors table in detection.go
  3. Implement matchFilename (Phase 1) and/or checkContent (Phase 2) functions
  4. Add test fixtures in testdata/
  5. AllFilterOptions() and AllFilterReasons() update automatically
  • Ensure all tests pass: go test -race ./...
  • Ensure linting passes: golangci-lint run
  • Add tests for new functionality
  • Keep changes focused and atomic