Thank you for your interest in contributing to clockz! This guide will help you get started.
By participating in this project, you agree to maintain a respectful and inclusive environment for all contributors.
- Fork the repository
- Clone your fork:
git clone https://github.com/yourusername/clockz.git - Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes
- Run tests:
go test ./... - Commit your changes with a descriptive message
- Push to your fork:
git push origin feature/your-feature-name - Create a Pull Request
- Follow standard Go conventions
- Run
go fmtbefore committing - Add comments for exported functions and types
- Keep functions small and focused
- Write tests for new functionality
- Ensure all tests pass:
go test ./... - Include benchmarks for performance-critical code
- Aim for good test coverage
- Update documentation for API changes
- Add examples for new features
- Keep doc comments clear and concise
- Use GitHub Issues
- Include minimal reproduction code
- Describe expected vs actual behavior
- Include Go version and OS
- Open an issue for discussion first
- Explain the use case
- Consider backwards compatibility
New clock implementations should:
- Implement the
Clockinterface - Handle context cancellation properly
- Include comprehensive tests
- Add documentation with examples
New testing utilities should:
- Follow the existing pattern
- Support deterministic testing
- Include tests for error cases
- Document behavior clearly
New examples should:
- Solve a real-world problem
- Include tests and benchmarks
- Have a descriptive README
- Follow the existing structure
- Keep PRs focused - One feature/fix per PR
- Write descriptive commit messages
- Update tests and documentation
- Ensure CI passes
- Respond to review feedback
Run the full test suite:
go test ./...Run with race detection:
go test -race ./...Run benchmarks:
go test -bench=. ./...clockz/
├── *.go # Core library files
├── *_test.go # Tests
├── testing/ # Testing utilities
│ └── integration/ # Integration tests
└── docs/ # Documentation
Follow conventional commits:
feat:New featurefix:Bug fixdocs:Documentation changestest:Test additions/changesrefactor:Code refactoringperf:Performance improvementschore:Maintenance tasks
This project uses automated release versioning. To create a release:
- Go to Actions → Release → Run workflow
- Leave "Version override" empty for automatic version inference
- Click "Run workflow"
The system will:
- Automatically determine the next version from conventional commits
- Create a git tag
- Generate release notes via GoReleaser
- Publish the release to GitHub
You can still create releases manually:
git tag v1.2.3
git push origin v1.2.3- Protected branches: The automated release cannot bypass branch protection rules. This is by design for security.
- Concurrent releases: Rapid successive releases may fail. Simply retry after a moment.
- Conventional commits required: Version inference requires conventional commit format (
feat:,fix:, etc.)
feat:new features (minor version: 1.2.0 → 1.3.0)fix:bug fixes (patch version: 1.2.0 → 1.2.1)feat!:breaking changes (major version: 1.2.0 → 2.0.0)docs:,test:,chore:no version change
Example: feat(clock): add timeout support for clock operations
Every PR automatically shows the next version that will be created:
- Check PR comments for "Version Preview"
- Updates automatically as you add commits
- Helps verify your commits have the intended effect
- Open an issue for questions
- Check existing issues first
- Be patient and respectful
Thank you for contributing to clockz!