Skip to content

Commit 50dc792

Browse files
committed
Update CONTRIBUTING.md to talk about rustfmt in CI
1 parent 42d8133 commit 50dc792

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

CONTRIBUTING.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,24 +114,26 @@ $ cargo test -p tests_expectations
114114

115115
## Automatic code formatting
116116

117-
There's a `rustfmt.toml` file in the repo. Ideally changes should be consistent
118-
with the style, though that's not enforced right now.
117+
We use [`rustfmt`](https://github.com/rust-lang-nursery/rustfmt) to enforce a
118+
consistent code style across the whole `bindgen` code base. This is enforced in
119+
CI, and your pull requests will get automatically rejected if you don't
120+
re-format with the latest `rustfmt` before pushing.
119121

120-
[`rustfmt`](https://github.com/rust-lang-nursery/rustfmt) can catch and fix
121-
automatically all the coding style issues it finds. In order to use it it
122-
suffices to do:
122+
You can install the latest version of `rustfmt` with this command:
123123

124124
```
125-
$ cargo fmt
125+
$ cargo install -f rustfmt
126126
```
127127

128-
For it to work, you need to have `rustfmt` installed. To do so:
128+
Ensure that `~/.cargo/bin` is on your path.
129+
130+
Once that is taken care of, you can (re)format all code by running this command:
129131

130132
```
131-
$ cargo install rustfmt
133+
$ cargo fmt
132134
```
133135

134-
And ensure `~/.cargo/bin` is on your path.
136+
The code style is described in the `rustfmt.toml` file in top level of the repo.
135137

136138
## Debug Logging
137139

0 commit comments

Comments
 (0)