Thank you for your interest in contributing to BeBytes! This guide will help you get started.
- Rust 1.73 or later
- Git
We use git hooks to ensure code quality before commits reach CI. This saves time by catching issues early.
Run the setup script from the project root:
./setup-hooks.shYou'll be presented with options:
- Fast checks (Recommended for development) - Runs formatting, clippy, and compilation checks
- Full validation - Runs all CI checks including tests for both std and no_std
- Custom - Choose which hooks to install
- Pre-commit framework - Uses the Python pre-commit framework
Alternatively, you can manually set up hooks:
# Use fast checks for development
ln -s ../../.githooks/pre-commit-fast .git/hooks/pre-commit
# Or use full validation
ln -s ../../.githooks/pre-commit .git/hooks/pre-commit
ln -s ../../.githooks/pre-push .git/hooks/pre-push
# Or configure git to use the .githooks directory
git config core.hooksPath .githooks- pre-commit-fast: Quick validation (formatting, clippy, compilation)
- pre-commit: Full CI validation (all tests, std and no_std)
- pre-push: Runs full validation before pushing
If you need to bypass hooks temporarily:
git commit --no-verify
git push --no-verify- Run
cargo fmtbefore committing - Fix all
cargo clippy -- -W clippy::pedanticwarnings - Ensure tests pass with both std and no_std features
Run all tests:
cargo test
cargo test --no-default-featuresRun specific test categories:
cargo test --test compile_fail # Compile-time error tests- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Ensure all hooks pass
- Commit your changes
- Push to your fork
- Open a Pull Request
Our CI runs the following checks:
cargo fmt -- --checkcargo clippy -- -W clippy::pedanticcargo build(with and without default features)cargo test(with and without default features)
The pre-commit hooks run these same checks locally.