Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Contributing

Thank you for your interest in contributing to rok-utils!

Getting Started

  1. Fork the repository
  2. Clone your fork: git clone https://github.com/YOUR_USERNAME/rok-utils.git
  3. Add upstream: git remote add upstream https://github.com/ateeq1999/rok-utils.git
  4. Install Rust (latest stable)
  5. 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 fmt before 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> or Option<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.