Thank you for contributing to bedrock-rs. This document explains the expected workflow for code changes, quality checks, and pull requests.
- Fork the repository and create a branch from
main. - Keep your branch focused on a single change (bug fix, feature, refactor, etc.).
- If possible, discuss larger changes in an issue before implementation.
Install Rust toolchain and required components:
rustup toolchain install stable
rustup component add rustfmt clippyClone and enter the project:
git clone https://github.com/bedrock-crustaceans/bedrock-rs.git
cd bedrock-rsWhen making code changes, run these checks before opening a PR:
cargo fmt --all
cargo check --workspace
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspaceIf you want a quick local validation pass, you can run:
cargo fmt --all -- --check
cargo check --workspaceThis workspace is modular; some code paths are behind feature flags. When your change touches feature-gated logic, validate with appropriate feature sets:
cargo check --all-features
cargo test --all-featuresFor crate-specific changes, also validate the related package directly:
cargo test -p bedrock_protocol- Use clear commit messages that explain the intent.
- Keep commits small and reviewable.
- Avoid mixing formatting-only changes with behavioral changes in the same commit.
- Any commit message style is acceptable (Conventional Commit or normal/free style).
Examples:
fix(proto): correct packet decode bounds checkFix packet decode bounds check in protofeat(server): add connection timeout configurationAdd connection timeout configuration to server builderRefactor level key parsing
- Ensure your branch is up to date with
main. - Push your branch and open a Pull Request.
- In the PR description, include:
- What changed.
- Why the change is needed.
- How you validated it (commands/results).
- Any breaking changes or migration notes.
- Link related issues (for example:
Closes #123). - Respond to review feedback with follow-up commits.
Before requesting review, confirm:
- Code is formatted with
cargo fmt --all. - Build passes with
cargo check --workspace. - Lints pass with
cargo clippy --workspace --all-targets -- -D warnings. - Tests pass with
cargo test --workspace. - Relevant feature-flag combinations were checked.
- Documentation/examples were updated if behavior changed.
When opening an issue:
- Provide clear reproduction steps.
- Include expected vs actual behavior.
- Share environment details (OS, Rust version, enabled features).
- Include logs/errors and a minimal example if possible.
For help or discussion, join the project Discord: https://discord.com/invite/VCVcrvt3JC