Skip to content

Latest commit

 

History

History
59 lines (39 loc) · 2.38 KB

CONTRIBUTING.md

File metadata and controls

59 lines (39 loc) · 2.38 KB

Contributing

All contributors are expected to follow our Code of Conduct.

Pull requests

Before opening large pull requests, it is preferred that the change be discussed in a github issue first. This helps keep everyone on the same page, and facilitates a smoother code review process.

Testing

The CI system conducts a few different tests for various releases of rust. In addition to the normal cargo tests, code formatting is checked with fmt, and linting is checked with clippy. Whereas cargo tests are run for all rust release channels, fmt and clippy are only run on the stable channel.

Channel fmt clippy test
stable x x x
beta x
nightly x

To avoid any surprises by CI while merging, it's recommended you run these locally after making changes. Setup and testing only takes a couple minutes at most.

Setup

Rust does not have fmt or clippy installed by default, so you will have to add them manually. The installation process is unlikely to change, but if it does, specific installation instructions can be found on the READMEs for fmt and clippy.

rustup component add rustfmt-preview clippy-preview

If you want install to a different toolchain (if for instance your default is set to nightly, but you need to test stable), you can provide the 'toolchain' argument:

rustup component add rustfmt-preview clippy-preview --toolchain stable

We are using Prettier to check .json|.graphql files. To have it on your local machine you need to install Node.js first. Our build is now using latest LTS version of Node.js. We're using npm and global install here:

npm install --global prettier

Running

If you are on the stable channel, then you can run fmt, clippy, and tests.

cargo fmt --all -- --check
cargo clippy
cargo test --all

If your default channel is something other than stable, you can force the use of stable by providing the channel option:

cargo +stable fmt --all -- --check
cargo +stable clippy
cargo +stable test --all