Skip to content

Commit ecd7197

Browse files
committed
Update the contribution guide
1 parent 9334353 commit ecd7197

1 file changed

Lines changed: 14 additions & 28 deletions

File tree

CONTRIBUTING.md

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,6 @@ Thank you! We'll try to respond as quickly as possible.
5555
1. Install Rust using [rustup], which allows you to easily switch between Rust
5656
versions. Diesel currently supports Rust Stable, Nightly, Rust Beta.
5757

58-
To run Diesel's test suite with _all_ supported features (extra
59-
lints and compiletest), you should use the same nightly version as Diesel's
60-
continuous integration. Find it by looking for a line like
61-
`rust: nightly-2017-06-06` in the `.travis.yml` file. You can install and
62-
set a custom nightly version for a project using
63-
64-
```
65-
rustup override add nightly-2017-09-20
66-
```
67-
6858
2. Install the system libraries needed to interface with the database systems
6959
you wish to use.
7060

@@ -113,38 +103,34 @@ Thank you! We'll try to respond as quickly as possible.
113103
by executing `bin/test`. (Initially, this will take a while to compile
114104
everything.)
115105

116-
- One thing to note is that this script runs Clippy checks by default.
117-
Since this requires the nightly compiler, you can run the tests on stable with
118-
the following:
119-
```bash
120-
bin/test
121-
```
122-
123106
[rustup]: https://www.rustup.rs
124107

125108
### Coding Style
126109

127110
We follow the [Rust Style Guide](https://github.com/rust-lang-nursery/fmt-rfcs/blob/master/guide/guide.md), enforced using [rustfmt](https://github.com/rust-lang-nursery/rustfmt).
128111
To run rustfmt tests locally:
129112

130-
1. Use rustup to set rust toolchain
131-
to the nightly version specified in Diesel's [.travis.yml](./.travis.yml)
132-
(see above).
113+
1. Use rustup to set rust toolchain to the version specified in the
114+
[rust-toolchain file](./rust-toolchain).
133115

134-
2. Install the nightly version of rustfmt used in
135-
Diesel's continuous integration.
136-
Look for and run the line from [.travis.yml](./.travis.yml) that looks like
116+
2. Install the rustfmt and clippy by running
117+
```
118+
rustup component add rustfmt-preview
119+
rustup component add clippy-preview
120+
```
137121

122+
3. Run clippy using cargo from the root of your diesel repo.
138123
```
139-
cargo install rustfmt-nightly --vers x.x.x
124+
cargo clippy
140125
```
126+
Each PR needs to compile without warning.
127+
128+
4. Run rustfmt using cargo from the root of your diesel repo.
141129

142-
3. Run rustfmt using cargo from the root of your diesel repo.
143-
144130
To see changes that need to be made, run
145131

146132
```
147-
cargo fmt --all -- --write-mode=diff
133+
cargo fmt --all -- --check
148134
```
149135

150136
If all code is properly formatted (e.g. if you have not made any changes),
@@ -153,7 +139,7 @@ To run rustfmt tests locally:
153139
you will see a diff between your code and properly formatted code.
154140
If you see code here that you didn't make any changes to
155141
then you are probably running the wrong version of rustfmt.
156-
Once you are ready to apply the formatting changes, run
142+
Once you are ready to apply the formatting changes, run
157143

158144
```
159145
cargo fmt --all

0 commit comments

Comments
 (0)