From 825db18a472832e8a76cfbbe0032353aff22a85b Mon Sep 17 00:00:00 2001 From: data-pup Date: Mon, 16 Apr 2018 18:49:01 -0700 Subject: [PATCH] Added notes on configuring rustfmt to contributing.md. --- CONTRIBUTING.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f3c600f..a97e323 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,3 +3,58 @@ This project is currently not ready for code contributions! However, please do take a look at the issue tracker. Issues marked "question" are excellent places to share feedback. + +## Submitting a PR + +Before you submit your pull request, check that you have completed all of the +steps mentioned in the pull request template. Link the issue that your pull +request is responding to, and format your code using [rustfmt][rustfmt]. + +### Configuring rustfmt + +Before submitting code in a PR, make sure that you have formatted the codebase +using [rustfmt][rustfmt]. `rustfmt` is a tool for formatting Rust code, which +helps keep style consistent across the project. If you have not used `rustfmt` +before, it is not too difficult. + +If you have not already configured `rustfmt` for the +nightly toolchain, it can be done using the following steps: + +**1. Use Nightly Toolchain** + +Use the `rustup override` command to make sure that you are using the nightly +toolchain. Run this command in the `wasm-pack` directory you cloned. + +```sh +rustup override set nightly +``` + +**2. Add the rustfmt component** + +Install the most recent version of `rustfmt` using this command: + +```sh +rustup component add rustfmt-preview --toolchain nightly +``` + +**3. Running rustfmt** + +To run `rustfmt`, use this command: + +```sh +cargo +nightly fmt +``` + +[rustfmt]: https://github.com/rust-lang-nursery/rustfmt + +## Conduct + +As mentioned in the readme file, this project is a part of the +[rust-wasm][rust-wasm] group. As such, contributors should be sure to follow +the rust-wasm group's [code of conduct][rust-wasm-coc], as well as the Rust +language [code of conduct][rust-coc]. + +[rust-wasm]: https://github.com/rust-lang-nursery/rust-wasm +[rust-wasm-coc]:working://github.com/rust-lang-nursery/rust-wasm/blob/master/CODE_OF_CONDUCT.md +[rust-coc]: https://www.rust-lang.org/en-US/conduct.html +