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