Thank you for your interest in contributing to cpdb-rs! This document provides guidelines and information for contributors.
- Rust 1.85+ (2024 edition)
- cpdb-libs C library installed on your system
- Git
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/your-username/cpdb-rs.git cd cpdb-rs - Add the upstream repository:
git remote add upstream https://github.com/OpenPrinting/cpdb-rs.git
- Install dependencies:
cargo build
# Build the project
cargo build
# Run tests
cargo test
# Run tests with output
cargo test -- --nocapture
# Run specific test
cargo test test_name
# Check formatting
cargo fmt --all -- --check
# Run clippy
cargo clippy --all-targets --all-features -- -D warnings
# Build documentation
cargo doc --no-deps --open- Follow Rust naming conventions
- Use
cargo fmtto format code - Use
cargo clippyto catch common issues - Write comprehensive documentation
- Add tests for new functionality
Use clear, descriptive commit messages:
feat: add printer options support
fix: handle null pointer in settings
docs: update README with new examples
test: add unit tests for media handling
-
Create a feature branch from
main:git checkout -b feature/your-feature-name
-
Make your changes and commit them:
git add . git commit -m "feat: add your feature"
-
Push your branch:
git push origin feature/your-feature-name
-
Create a pull request on GitHub
-
Ensure all CI checks pass
-
Address any review feedback
- Add unit tests for new functionality
- Add integration tests for complex features
- Ensure all existing tests pass
- Test on multiple platforms when possible
- Update README.md for user-facing changes
- Add doc comments for public APIs
- Include examples in documentation
- Update CHANGELOG.md for significant changes
- Additional printer backends support
- Enhanced error handling and recovery
- Performance optimizations
- Cross-platform testing
- Documentation improvements
- Async/await support
- More comprehensive examples
- Benchmarking suite
- Fuzz testing
- Windows support (if feasible)
- Additional utility functions
- More detailed logging
- Configuration management
- Plugin system
When reporting bugs, please include:
- Operating system and version
- Rust version (
rustc --version) - cpdb-libs version
- Steps to reproduce
- Expected vs actual behavior
- Error messages or logs
For feature requests, please include:
- Use case description
- Proposed API design
- Implementation considerations
- Backward compatibility impact
- Respond to review feedback promptly
- Make requested changes in new commits
- Ask questions if feedback is unclear
- Test changes thoroughly
- Be constructive and helpful
- Focus on code quality and correctness
- Check for security issues
- Verify tests and documentation
Releases are managed by maintainers. Since this project is structured as a workspace, cpdb-sys must be published to crates.io before cpdb-rs.
- Update the version in
cpdb-sys/Cargo.toml. - Update the version in
Cargo.toml(both forcpdb-rspackage version and thecpdb-sysdependency version in[dependencies]). - Update
CHANGELOG.md. - Create a release tag (e.g.,
v0.1.0). - Publish
cpdb-sysfirst:
cd cpdb-sys
cargo publish- Publish
cpdb-rs:
cargo publish- Create the GitHub release.
- Be respectful and inclusive
- Help others learn and grow
- Share knowledge and experience
- Follow the Rust Code of Conduct
- GitHub Issues for bug reports and feature requests
- GitHub Discussions for questions and general discussion
- Rust Discord for real-time chat
- Documentation for API reference
By contributing to cpdb-rs, you agree that your contributions will be licensed under the MIT License.
Contributors will be recognized in:
- CONTRIBUTORS.md file
- Release notes
- GitHub contributors page
Thank you for contributing to cpdb-rs!