Contributing
Development Setup
Section titled “Development Setup”Requirements: Go 1.26+
git clone https://github.com/LarsArtmann/gogenfilter.gitcd gogenfiltergo mod downloadBuilding
Section titled “Building”go build ./...Testing
Section titled “Testing”# Run all testsgo test ./...
# With race detectorgo test -race ./...Linting
Section titled “Linting”Uses golangci-lint v2:
golangci-lint runCode Style
Section titled “Code Style”- Table-driven tests where possible
t.Parallel()withint.Run()for test isolation- Functional options pattern for configuration
- Strong types over runtime checks
- Early returns over nested conditionals
Adding a Generator
Section titled “Adding a Generator”- Add a
FilterOptionandFilterReasonconst with the same string value intypes.go - Add a detector entry in the
detectorstable indetection.go - Implement
matchFilename(Phase 1) and/orcheckContent(Phase 2) functions - Add test fixtures in
testdata/ AllFilterOptions()andAllFilterReasons()update automatically
Pull Requests
Section titled “Pull Requests”- Ensure all tests pass:
go test -race ./... - Ensure linting passes:
golangci-lint run - Add tests for new functionality
- Keep changes focused and atomic