Skip to content

Commit 7e6a0ab

Browse files
committed
Add a section about automatic code formatting in CONTRIBUTING.md
1 parent 011044f commit 7e6a0ab

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

CONTRIBUTING.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ yourself.
1212
* [Running All Tests](#tests-all)
1313
* [Running a Single, Specific Test](#tests-one)
1414
* [Authoring New Tests](#tests-new)
15+
* [Automatic Code Formatting](#formatting)
1516
* [Debug Logging](#logs)
1617

1718
## Code of Conduct <span id="coc"/>
@@ -95,6 +96,27 @@ specify the required features at the top of the test header in a similar manner:
9596
// bingden-features: llvm_stable
9697
```
9798

99+
## Automatic code formatting <span id="formatting"/>
100+
101+
There's a `rustfmt.toml` file in the repo. Ideally changes should be consistent
102+
with the style, though that's not enforced right now.
103+
104+
[`rustfmt`](https://github.com/rust-lang-nursery/rustfmt) can catch and fix
105+
automatically all the coding style issues it finds. In order to use it it
106+
suffices to do:
107+
108+
```
109+
$ cargo fmt
110+
```
111+
112+
For it to work, you need to have `rustfmt` installed. To do so:
113+
114+
```
115+
$ cargo install rustfmt
116+
```
117+
118+
And ensure `~/.cargo/bin` is on your path.
119+
98120
## Debug Logging <span id="logs"/>
99121

100122
To help debug what `bindgen` is doing, you can define the environment variable

0 commit comments

Comments
 (0)