Skip to content

Commit f583152

Browse files
authored
Merge pull request #3465 from flip1995/rustfmt
rustfmt everything once and for all
2 parents a03ce65 + 14d1e8d commit f583152

File tree

150 files changed

+3192
-2864
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+3192
-2864
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ before_install:
3030
install:
3131
- |
3232
if [ -z ${INTEGRATION} ]; then
33+
rustup component add rustfmt-preview || cargo install --git https://github.com/rust-lang/rustfmt/ --force
3334
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
3435
. $HOME/.nvm/nvm.sh
3536
nvm install stable

CONTRIBUTING.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ All contributors are expected to follow the [Rust Code of Conduct](http://www.ru
1717
* [Author lint](#author-lint)
1818
* [Documentation](#documentation)
1919
* [Running test suite](#running-test-suite)
20+
* [Running rustfmt](#running-rustfmt)
2021
* [Testing manually](#testing-manually)
22+
* [Linting Clippy with your local changes](#linting-clippy-with-your-local-changes)
2123
* [How Clippy works](#how-clippy-works)
2224
* [Fixing nightly build failures](#fixing-build-failures-caused-by-rust)
2325
* [Contributions](#contributions)
@@ -146,14 +148,26 @@ Therefore you should use `tests/ui/update-all-references.sh` (after running
146148
`cargo test`) and check whether the output looks as you expect with `git diff`. Commit all
147149
`*.stderr` files, too.
148150

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+
149163
### Testing manually
150164

151165
Manually testing against an example file is useful if you have added some
152166
`println!`s and test suite output becomes unreadable. To try Clippy with your
153167
local modifications, run `env CLIPPY_TESTS=true cargo run --bin clippy-driver -- -L ./target/debug input.rs`
154168
from the working copy root.
155169

156-
### Linting Clippy with your changes locally
170+
### Linting Clippy with your local changes
157171

158172
Clippy CI only passes if all lints defined in the version of the Clippy being
159173
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
246260
be reviewed by a core contributor (someone with permission to land patches) and either landed in the
247261
main tree or given feedback for changes that would be required.
248262

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.
250265

251266
<!-- adapted from https://github.com/servo/servo/blob/master/CONTRIBUTING.md -->
252267

build.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
// option. This file may not be copied, modified, or distributed
88
// except according to those terms.
99

10-
1110
fn main() {
1211
// Forward the profile to the main compilation
1312
println!("cargo:rustc-env=PROFILE={}", std::env::var("PROFILE").unwrap());

ci/base-tests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ cd clippy_dev && cargo test && cd ..
2626

2727
# Perform various checks for lint registration
2828
./util/dev update_lints --check
29+
cargo +nightly fmt --all -- --check
2930

3031
CLIPPY="`pwd`/target/debug/cargo-clippy clippy"
3132
# run clippy on its own codebase...

0 commit comments

Comments
 (0)