summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <ecoal95@gmail.com>2016-11-01 15:07:28 +0100
committerEmilio Cobos Álvarez <ecoal95@gmail.com>2016-11-01 17:15:18 +0100
commit7e6a0ab7586f66ff421ddb46fa381b59c34742ea (patch)
tree12452df168c0ae15b7b66642b41741f35c574a0d
parent011044fd7c22e25743f9cebdf0aaa32ccbdec987 (diff)
Add a section about automatic code formatting in CONTRIBUTING.md
-rw-r--r--CONTRIBUTING.md22
1 files changed, 22 insertions, 0 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 001ad0e2..c7e5198c 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -12,6 +12,7 @@ yourself.
* [Running All Tests](#tests-all)
* [Running a Single, Specific Test](#tests-one)
* [Authoring New Tests](#tests-new)
+* [Automatic Code Formatting](#formatting)
* [Debug Logging](#logs)
## 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:
// bingden-features: llvm_stable
```
+## Automatic code formatting <span id="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.
+
+[`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:
+
+```
+$ cargo fmt
+```
+
+For it to work, you need to have `rustfmt` installed. To do so:
+
+```
+$ cargo install rustfmt
+```
+
+And ensure `~/.cargo/bin` is on your path.
+
## Debug Logging <span id="logs"/>
To help debug what `bindgen` is doing, you can define the environment variable