diff options
author | Nick Fitzgerald <fitzgen@gmail.com> | 2017-02-03 12:44:41 -0800 |
---|---|---|
committer | Nick Fitzgerald <fitzgen@gmail.com> | 2017-02-03 12:44:41 -0800 |
commit | 50dc79237b9cb4d822d449f9b5b674a0798f429a (patch) | |
tree | 08849ef4a8907fc51364a57c4f3a2c218b8aadf9 | |
parent | 42d8133c39fd8097b6fb276f28ac637bb7565862 (diff) |
Update CONTRIBUTING.md to talk about rustfmt in CI
-rw-r--r-- | CONTRIBUTING.md | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cfcee653..9ee1b4ac 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -114,24 +114,26 @@ $ cargo test -p tests_expectations ## Automatic code formatting -There's a `rustfmt.toml` file in the repo. Ideally changes should be consistent -with the style, though that's not enforced right now. +We use [`rustfmt`](https://github.com/rust-lang-nursery/rustfmt) to enforce a +consistent code style across the whole `bindgen` code base. This is enforced in +CI, and your pull requests will get automatically rejected if you don't +re-format with the latest `rustfmt` before pushing. -[`rustfmt`](https://github.com/rust-lang-nursery/rustfmt) can catch and fix -automatically all the coding style issues it finds. In order to use it it -suffices to do: +You can install the latest version of `rustfmt` with this command: ``` -$ cargo fmt +$ cargo install -f rustfmt ``` -For it to work, you need to have `rustfmt` installed. To do so: +Ensure that `~/.cargo/bin` is on your path. + +Once that is taken care of, you can (re)format all code by running this command: ``` -$ cargo install rustfmt +$ cargo fmt ``` -And ensure `~/.cargo/bin` is on your path. +The code style is described in the `rustfmt.toml` file in top level of the repo. ## Debug Logging |