Skip to content

Latest commit

 

History

History
55 lines (41 loc) · 2.48 KB

CONTRIBUTING.md

File metadata and controls

55 lines (41 loc) · 2.48 KB

Contributing to YOUR PROJECT NAME HERE

  1. Development Workspace Setup
  2. Commands
  3. Formatting and Linting Code
  4. Code Policy

Development Workspace Setup

The main facility used for interacting with this project's lifecycle (build/test/format/lint) is cargo-make. Therefore, this is the only dependency you need to install on your machine:

cargo install cargo-make

Commands

With cargo-make, all of this project's commands will become available to you:

cargo make clean            # Clean up temporary files
cargo make build            # Lint and build the project
cargo make run              # Run the application
cargo make test             # Run all unit tests
cargo make test-coverage    # Run all unit tests and write a code coverage report to STDOUT
cargo make test-coverage-ci # Run all unit tests and write a code coverage report to a text file in LCOV format
cargo make format           # Format (rewrite) every applicable file in the project
cargo make format-ci        # Format (report only) every applicable file in the project
cargo make lint             # Lint (report only) every applicable file in the project
cargo make lint-watch       # Lint (report only) every applicable file in the project and re-lints whenever files change

cargo-make will automatically fetch crates and toolchain components as needed when you run these commands. Between this and what is defined in Cargo.toml, you should never need to issue a cargo install command unless you are installing new dependencies.

Formatting and Linting Code

This project uses rustfmt to handle formatting, and contributions to its code are expected to be formatted with rustfmt (within reason) using the settings in rustfmt.toml.

This project uses rust-clippy to handle linting, and contributions are expected to be checked using the settings in clippy.toml.

Note: rustfmt and rust-clippy each have many built-in defaults that will be used in the absence of a corresponding rule in rustfmt.toml/clippy.toml.

Code Policy

Code contributed to this project should follow the Rust API Guidelines as much as possible (even if this project is an application rather than a library).