Thank you for your interest in contributing to txeh!
- Go 1.21+ required
- Install development tools (pin to specific versions for reproducibility):
# Linting
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.56.2
# Security scanning
go install github.com/securego/gosec/v2/cmd/gosec@v2.19.0
go install golang.org/x/vuln/cmd/govulncheck@v1.0.4
# Import organization
go install golang.org/x/tools/cmd/goimports@v0.18.0git clone https://github.com/txn2/txeh.git
cd txeh
make deps
make build- Fork the repository
- Create a feature branch:
git checkout -b feat/your-feature - Make changes with tests
- Run
make verifybefore committing - Submit PR with description using the PR template
- Run
make fmtbefore committing - Code must pass
golangci-lintwith project config
- All exported functions need doc comments
- Doc comments must start with the name being documented
- Comments should end with a period
- Always check and handle errors (no
_for errors) - Wrap errors at boundaries:
fmt.Errorf("context: %w", err) - Use
errors.Isanderrors.As, never string comparison
- Follow Effective Go naming conventions
- Error messages should be lowercase, no punctuation
- Avoid stuttering (e.g.,
http.HTTPServer→http.Server)
Use conventional commits:
feat:New featuresfix:Bug fixesdocs:Documentation changestest:Test additions/changesrefactor:Code refactoringperf:Performance improvementssecurity:Security fixeschore:Maintenance tasks
Examples:
feat: add support for IPv6 CIDR ranges
fix: handle empty hostname in AddHost
docs: update README with new CLI flags
test: add coverage for RemoveAddress edge cases
- Add tests for new functionality
- Maintain 82%+ coverage
- Run
go test -race ./...to check for race conditions
# Run all tests
make test
# Run tests with coverage
make coverage
# Run linting
make lint
# Run full verification suite
make verify
# Run specific test
go test -v -run TestSpecific ./...Before submitting a PR, ensure:
-
make verifypasses - New code has tests
- Documentation updated if needed
- Commit messages follow conventions
- Check existing issues before creating a new one
- Use the issue templates provided
- Include version, OS, and reproduction steps
Please report security vulnerabilities privately. See SECURITY.md for details.
By contributing, you agree that your contributions will be licensed under the Apache License 2.0.