Skip to content

Latest commit

 

History

History
99 lines (61 loc) · 2.88 KB

DEVELOPMENT.md

File metadata and controls

99 lines (61 loc) · 2.88 KB

This guide is meant for people wishing to contribute to this open-source project. For more information on contributing, see CONTRIBUTING.

Prerequisites

Rust

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

Rust nightly

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

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.

Tarpaulin

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

Development

Running the tests

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.

Linting

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.

Code coverage

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.

Generating documentation

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.

Questions?

If any part of this documentation is unclear, please open a new issue so it can be fixed.