Skip to content

Latest commit

 

History

History
52 lines (39 loc) · 5.52 KB

contributing.md

File metadata and controls

52 lines (39 loc) · 5.52 KB

Contributor Guide

Prepare the development environment

Install the Rust toolchain

Install the Rust toolchain by installing Rustup with the standard and the nightly toolchains.

Setup the Rust toolchain

If you are using a shell capable of running Bash scripts, run the following from the project root directory:

$ ./setup.sh

Otherwise, follow these manual steps:

  1. Install Rustfmt.

  2. Install Clippy.

  3. Install the cargo-deny Cargo plugin.

  4. Install the cargo-udeps Cargo plugin.

  5. If an installation of the pugins cargo-deny, cargo-udeps fails, you may need to install pkg-config, libssl-dev. For example:

    $ sudo apt-get install pkg-config && sudo apt-get install libssl-dev

Build-related commands

This project uses Cargo for build automation.

Run from the project root directory:

# Command Description
0 cargo deny check && cargo +nightly udeps && cargo +nightly clippy --all-targets --all-features && cargo +nightly fmt --check && cargo +nightly test && cargo +nightly doc --no-deps -Zrustdoc-map Analyzes and reports errors, checks style, runs tests.
0.1 cargo +nightly fmt Reformats the code usingrustfmt.
0.2 cargo clean Deletes thetarget directory.
1 cargo +nightly doc --no-deps -Zrustdoc-map --open Generates documentation and opens it in a browser. See https://doc.rust-lang.org/cargo/reference/unstable.html#rustdoc-map .
1.1 cargo clean --doc Deletes the target/doc directory.
2 cargo +nightly build Builds the project into thetarget/debug directory using the dev Cargo profile.
2.1 cargo +nightly build --release Builds the project into thetarget/release directory using the release Cargo profile.
3 cargo +nightly run -- 2> stderr Runs the debug executable, builds the project if necessary. stderr is redirected to the stderr file to catch panic messages, as per https://docs.rs/cursive/latest/cursive/#debugging.
3.1 cargo +nightly run --release Runs the release executable, builds the project if necessary.