This guide is meant for people wishing to contribute to this open-source project. For more information on contributing, see CONTRIBUTING.
You need at least Rust 1.68.2 (TODO validate this minimum version) to build this project's code and run the tests. You can install Rust from the official website.
If you already have a version of Rust installed via rustup
but it's too old, you can update by running
rustup update
In order to run rustfmt
, you will need a Nightly Rust toolset. If you do not have one installed, you can install one via rustup
by running
rustup toolchain install nightly
If you already have one installed but it was too old, it was probably updated earlier when you ran rustup update
😉
just is a command-line tool to run scripts, a bit like npm
's scripts. It's written in Rust.
This project includes a justfile that makes it easier to run the various tools used for development. To install just
via cargo
, simply run
cargo install just
If you have cargo-binstall, it'll probably be faster to use it instead:
cargo binstall just
You can also install it via various methods.
If you want to run tests with coverage locally, you'll need to install cargo-tarpaulin
, a code coverage tool for Rust. You can install it via cargo
:
cargo install cargo-tarpaulin
You can also install it via cargo-binstall:
cargo binstall cargo-tarpaulin
In order to run all tests, you can use
just test
Any new feature or bug fix would need new tests to validate. Make sure all tests pass before submitting a PR.
Before submitting a PR, make sure rustfmt
and clippy
are happy. To tidy up your code before committing, simply run
just tidy
Required checks will not pass if either of those report issues.
This project's code coverage settings are pretty stringent and require 100% coverage. To validate this locally, you can run
just tarpaulin
Make sure coverage is at the required level before submitting a PR.
All public symbols in the crate need to be documented, otherwise checks won't pass. To validate this, you can generate docs locally by running
just doc
Make sure any new public symbol is documented before submitting a PR.
If any part of this documentation is unclear, please open a new issue so it can be fixed.