@@ -17,7 +17,9 @@ All contributors are expected to follow the [Rust Code of Conduct](http://www.ru
17
17
* [ Author lint] ( #author-lint )
18
18
* [ Documentation] ( #documentation )
19
19
* [ Running test suite] ( #running-test-suite )
20
+ * [ Running rustfmt] ( #running-rustfmt )
20
21
* [ Testing manually] ( #testing-manually )
22
+ * [ Linting Clippy with your local changes] ( #linting-clippy-with-your-local-changes )
21
23
* [ How Clippy works] ( #how-clippy-works )
22
24
* [ Fixing nightly build failures] ( #fixing-build-failures-caused-by-rust )
23
25
* [ Contributions] ( #contributions )
@@ -146,14 +148,26 @@ Therefore you should use `tests/ui/update-all-references.sh` (after running
146
148
` cargo test ` ) and check whether the output looks as you expect with ` git diff ` . Commit all
147
149
` *.stderr ` files, too.
148
150
151
+ ### Running rustfmt
152
+
153
+ [ Rustfmt] ( https://github.com/rust-lang/rustfmt ) is a tool for formatting Rust code according
154
+ to style guidelines. The code has to be formatted by ` rustfmt ` before a PR will be merged.
155
+
156
+ It can be installed via ` rustup ` :
157
+ ``` bash
158
+ rustup component add rustfmt-preview
159
+ ```
160
+
161
+ Use ` cargo fmt --all ` to format the whole codebase.
162
+
149
163
### Testing manually
150
164
151
165
Manually testing against an example file is useful if you have added some
152
166
` println! ` s and test suite output becomes unreadable. To try Clippy with your
153
167
local modifications, run ` env CLIPPY_TESTS=true cargo run --bin clippy-driver -- -L ./target/debug input.rs `
154
168
from the working copy root.
155
169
156
- ### Linting Clippy with your changes locally
170
+ ### Linting Clippy with your local changes
157
171
158
172
Clippy CI only passes if all lints defined in the version of the Clippy being
159
173
tested pass (that is, don’t report any suggestions). You can avoid prolonging
@@ -246,7 +260,8 @@ Contributions to Clippy should be made in the form of GitHub pull requests. Each
246
260
be reviewed by a core contributor (someone with permission to land patches) and either landed in the
247
261
main tree or given feedback for changes that would be required.
248
262
249
- All code in this repository is under the [ Mozilla Public License, 2.0] ( https://www.mozilla.org/MPL/2.0/ )
263
+ All code in this repository is under the [ Apache-2.0] ( http://www.apache.org/licenses/LICENSE-2.0> )
264
+ or the [ MIT] ( http://opensource.org/licenses/MIT ) license.
250
265
251
266
<!-- adapted from https://github.com/servo/servo/blob/master/CONTRIBUTING.md -->
252
267
0 commit comments