Contributing
Thank you for your interest in contributing to rok-utils!
Getting Started
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/rok-utils.git - Add upstream:
git remote add upstream https://github.com/ateeq1999/rok-utils.git - Install Rust (latest stable)
- Run tests:
cargo test --all-features
Development Workflow
1. Create a Branch
git checkout -b feature/your-feature-name
2. Make Changes
Follow the coding standards:
- Run
cargo fmtbefore committing - Run
cargo clippy --all-features -- -D warnings - Add tests for new functionality
- Keep files under 400 lines
3. Test Your Changes
cargo test --all-features
cargo test --no-default-features
cargo fmt --check
cargo clippy --all-features -- -D warnings
cargo test --doc
4. Commit and Push
git add .
git commit -m "feat: add new feature"
git push origin feature/your-feature-name
5. Open a Pull Request
Open a PR against main with a clear description.
Coding Standards
Error Handling
- Never use
unwrap()in library code - Return
Result<T, RokError>orOption<T> - Use
context()for error context
Naming Conventions
- Functions:
snake_case - Types:
PascalCase - Traits:
PascalCase
Documentation
- Document all public items
- Include examples for public functions
- Update this documentation site
Reporting Issues
- Use GitHub Issues for bugs and features
- Include minimal reproduction steps
- Specify Rust version and features used
License
By contributing, you agree that your contributions will be licensed under the MIT License.