Thank you for your interest in contributing to Quantum-Go! This document provides guidelines and instructions for contributing to the project.
- Code of Conduct
- Getting Started
- Development Setup
- Making Changes
- Testing
- Pull Request Process
- Security Vulnerabilities
This project follows the standard principles of respectful collaboration:
- Be respectful and considerate in all interactions
- Focus on constructive feedback
- Accept criticism gracefully
- Prioritize the security and reliability of the codebase
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/sara-star-quant/quantum-go.git cd quantum-go - Add upstream remote:
git remote add upstream https://github.com/sara-star-quant/quantum-go.git
- Go 1.26 or later (required)
- Git
- Make (optional, for build automation)
go mod downloadgo build ./...# All tests
go test ./... -v
# With race detection
go test ./... -race
# With coverage
go test ./... -coverprofile=coverage.txt
go tool cover -html=coverage.txtUse descriptive branch names:
feature/add-new-cipher-suitefix/handshake-timeoutdocs/update-api-examplestest/add-fuzz-coverage
- Follow standard Go conventions and
gofmtformatting - Run
go fmt ./...before committing - Run
go vet ./...to catch common issues - Use meaningful variable and function names
- Add comments for exported functions and types
- Keep functions focused and concise
Write clear, descriptive commit messages:
Brief summary (50 chars or less)
More detailed explanation if necessary. Wrap at 72 characters.
Explain the problem this commit solves and why the change is needed.
Fixes #123
All contributions must include appropriate tests:
-
Unit Tests: Test individual functions and components
go test ./pkg/chkem -v go test ./pkg/crypto -v
-
Integration Tests: Test complete workflows
go test ./test/integration -v -
Fuzz Tests: For any parsing or cryptographic functions
go test -fuzz=FuzzYourFunction -fuzztime=30s ./test/fuzz/ -
Benchmarks: For performance-critical changes
go test -bench=. -benchmem ./test/benchmark/
- Aim for >80% coverage for new code
- Critical cryptographic functions should have 100% coverage
- Include both positive and negative test cases
For cryptographic changes, add deterministic test vectors:
go test ./pkg/crypto -v -run "TestKAT"-
Update your branch with latest upstream:
git fetch upstream git rebase upstream/main
-
Run all tests:
go test ./... -race -
Run linters:
go vet ./... go fmt ./...
-
Update documentation if needed:
- Update README.md for user-facing changes
- Update doc.go for API changes
- Add comments to exported functions
-
Push your branch to your fork:
git push origin your-branch-name
-
Create a Pull Request on GitHub with:
- Clear title describing the change
- Detailed description of what changed and why
- Reference any related issues (Fixes #123)
- Screenshots/benchmarks for visual or performance changes
-
PR Checklist:
- Tests added/updated and passing
- Documentation updated
- Code formatted with
go fmt - No new warnings from
go vet - Commit messages are clear
- Branch is up-to-date with main
- Maintainers will review your PR and may request changes
- Address feedback by pushing new commits to your branch
- Once approved, maintainers will merge your PR
Do NOT open public issues for security vulnerabilities.
If you discover a security vulnerability:
-
Email the maintainers directly with:
- Description of the vulnerability
- Steps to reproduce
- Potential impact
- Suggested fix (if any)
-
Wait for confirmation before public disclosure
-
Allow reasonable time for a fix to be developed and released
See SECURITY.md for our security policy (if available).
We welcome various types of contributions:
- Fix incorrect behavior
- Add tests demonstrating the bug
- Ensure no regressions
- Discuss the feature in an issue first
- Ensure it aligns with project goals
- Include comprehensive tests
- Update documentation
- Fix typos or unclear explanations
- Add examples
- Improve API documentation
- Update architectural diagrams
- Increase test coverage
- Add edge case tests
- Add fuzz tests for security-critical code
- Add benchmarks
- Include benchmarks showing improvement
- Ensure no correctness regressions
- Document any trade-offs
If you have questions about contributing:
- Check existing issues and discussions
- Open a new issue with the
questionlabel - Be specific about what you're trying to achieve
By contributing, you agree that your contributions will be licensed under the MIT License, the same license as the project.
Thank you for contributing to Quantum-Go!