Skip to content

Commit e1488aa

Browse files
committed
submodules: update clippy from b2601be to 29bf75c
Changes: ```` Fix ty::TyKind usage Fix TyKind::<kind> usage in codebase Extract single_match_else UI test cargo fmt Adds inequality cases to bool comparison lint Remove unsafe_vector_initialization lint Fix wildcard_dependencies false positive Fix rustfmt format Disable incremental build for windows Travis: Add rustc sysroot bin to PATH for windows build Fix some nursery links Enforce LF lineendings for everything Mention triage procedure in contributing.md Keep testing large_digit_groups as ui test Keep testing unsafe_vector_initialization as ui test Downgrade large_digit_groups to pedantic Downgrade unsafe_vector_initialization to restriction remove macro_at_most_once_rep feature attribute since it's stable Add missing word Update docs in regards to the merged RFC Document how to run rustfmt in CONTRIBUTING.md Don't run integration tests in forks Fix some formatting issues Run rustfmt on clippy_lints Run rustfmt on build.rs Run rustfmt on clippy_dev Run rustfmt on rustc_tools_util Run rustfmt on src Run rustfmt on the tests Let travis run cargo fmt --all -- --check Error on line overflow ````
1 parent 4c7d644 commit e1488aa

File tree

165 files changed

+3627
-3266
lines changed

Some content is hidden

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

165 files changed

+3627
-3266
lines changed

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[attr]rust text eol=lf whitespace=tab-in-indent,trailing-space,tabwidth=4
2+
3+
* text=auto eol=lf
4+
*.rs rust

.travis.yml

Lines changed: 19 additions & 2 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
@@ -41,30 +42,46 @@ install:
4142
fi
4243
fi
4344
45+
# disabling the integration tests in forks should be done with
46+
# if: fork = false
47+
# but this is currently buggy travis-ci/travis-ci#9118
4448
matrix:
4549
include:
4650
- os: osx # run base tests on both platforms
4751
env: BASE_TESTS=true
4852
- os: linux
4953
env: BASE_TESTS=true
5054
- os: windows
51-
env: BASE_TEST=true
55+
env: CARGO_INCREMENTAL=0 BASE_TESTS=true
5256
- env: INTEGRATION=rust-lang/cargo
57+
if: repo =~ /^rust-lang\/rust-clippy$/
5358
- env: INTEGRATION=rust-random/rand
59+
if: repo =~ /^rust-lang\/rust-clippy$/
5460
- env: INTEGRATION=rust-lang-nursery/stdsimd
61+
if: repo =~ /^rust-lang\/rust-clippy$/
5562
- env: INTEGRATION=rust-lang/rustfmt
63+
if: repo =~ /^rust-lang\/rust-clippy$/
5664
- env: INTEGRATION=rust-lang-nursery/futures-rs
65+
if: repo =~ /^rust-lang\/rust-clippy$/
5766
- env: INTEGRATION=rust-lang-nursery/failure
67+
if: repo =~ /^rust-lang\/rust-clippy$/
5868
- env: INTEGRATION=rust-lang-nursery/log
69+
if: repo =~ /^rust-lang\/rust-clippy$/
5970
- env: INTEGRATION=rust-lang-nursery/chalk
71+
if: repo =~ /^rust-lang\/rust-clippy$/
6072
- env: INTEGRATION=rust-lang/rls
73+
if: repo =~ /^rust-lang\/rust-clippy$/
6174
- env: INTEGRATION=chronotope/chrono
75+
if: repo =~ /^rust-lang\/rust-clippy$/
6276
- env: INTEGRATION=serde-rs/serde
77+
if: repo =~ /^rust-lang\/rust-clippy$/
6378
- env: INTEGRATION=Geal/nom
79+
if: repo =~ /^rust-lang\/rust-clippy$/
6480
- env: INTEGRATION=hyperium/hyper
81+
if: repo =~ /^rust-lang\/rust-clippy$/
6582
allow_failures:
6683
- os: windows
67-
env: BASE_TEST=true
84+
env: CARGO_INCREMENTAL=0 BASE_TESTS=true
6885
# prevent these jobs with default env vars
6986
exclude:
7087
- os: linux

CONTRIBUTING.md

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ 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)
25+
* [Issue and PR Triage](#issue-and-pr-triage)
2326
* [Contributions](#contributions)
2427

2528
## Getting started
@@ -63,14 +66,15 @@ an AST expression). `match_def_path()` in Clippy's `utils` module can also be us
6366

6467
## Writing code
6568

66-
Compiling Clippy from scratch can take almost a minute or more depending on your machine.
67-
However, since Rust 1.24.0 incremental compilation is enabled by default and compile times for small changes should be quick.
68-
6969
[Llogiq's blog post on lints](https://llogiq.github.io/2015/06/04/workflows.html) is a nice primer
7070
to lint-writing, though it does get into advanced stuff. Most lints consist of an implementation of
7171
`LintPass` with one or more of its default methods overridden. See the existing lints for examples
7272
of this.
7373

74+
If you want to add a new lint or change existing ones apart from bugfixing, it's
75+
also a good idea to give the [stability guaratees][rfc_stability] and
76+
[lint categories][rfc_lint_cats] sections of the [Clippy 1.0 RFC][clippy_rfc] a
77+
quick read.
7478

7579
### Author lint
7680

@@ -127,7 +131,7 @@ Please document your lint with a doc comment akin to the following:
127131
/// ```
128132
```
129133

130-
Once your lint is merged it will show up in the [lint list](https://rust-lang-nursery.github.io/rust-clippy/master/index.html)
134+
Once your lint is merged it will show up in the [lint list](https://rust-lang.github.io/rust-clippy/master/index.html)
131135

132136
### Running test suite
133137

@@ -145,14 +149,26 @@ Therefore you should use `tests/ui/update-all-references.sh` (after running
145149
`cargo test`) and check whether the output looks as you expect with `git diff`. Commit all
146150
`*.stderr` files, too.
147151

152+
### Running rustfmt
153+
154+
[Rustfmt](https://github.com/rust-lang/rustfmt) is a tool for formatting Rust code according
155+
to style guidelines. The code has to be formatted by `rustfmt` before a PR will be merged.
156+
157+
It can be installed via `rustup`:
158+
```bash
159+
rustup component add rustfmt-preview
160+
```
161+
162+
Use `cargo fmt --all` to format the whole codebase.
163+
148164
### Testing manually
149165

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

155-
### Linting Clippy with your changes locally
171+
### Linting Clippy with your local changes
156172

157173
Clippy CI only passes if all lints defined in the version of the Clippy being
158174
tested pass (that is, don’t report any suggestions). You can avoid prolonging
@@ -239,13 +255,28 @@ rustup override set master
239255
cargo test
240256
```
241257

258+
## Issue and PR triage
259+
260+
Clippy is following the [Rust triage procedure][triage] for issues and pull
261+
requests.
262+
263+
However, we are a smaller project with all contributors being volunteers
264+
currently. Between writing new lints, fixing issues, reviewing pull requests and
265+
responding to issues there may not always be enough time to stay on top of it
266+
all.
267+
268+
Our highest priority is fixing [crashes][l-crash] and [bugs][l-bug]. We don't
269+
want Clippy to crash on your code and we want it to be as reliable as the
270+
suggestions from Rust compiler errors.
271+
242272
## Contributions
243273

244274
Contributions to Clippy should be made in the form of GitHub pull requests. Each pull request will
245275
be reviewed by a core contributor (someone with permission to land patches) and either landed in the
246276
main tree or given feedback for changes that would be required.
247277

248-
All code in this repository is under the [Mozilla Public License, 2.0](https://www.mozilla.org/MPL/2.0/)
278+
All code in this repository is under the [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0>)
279+
or the [MIT](http://opensource.org/licenses/MIT) license.
249280

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

@@ -263,3 +294,9 @@ All code in this repository is under the [Mozilla Public License, 2.0](https://w
263294
[toolstate_commit]: https://github.com/rust-lang-nursery/rust-toolstate/commit/6ce0459f6bfa7c528ae1886492a3e0b5ef0ee547
264295
[rtim]: https://github.com/kennytm/rustup-toolchain-install-master
265296
[rustup_component_history]: https://mexus.github.io/rustup-components-history
297+
[clippy_rfc]: https://github.com/rust-lang/rfcs/blob/master/text/2476-clippy-uno.md
298+
[rfc_stability]: https://github.com/rust-lang/rfcs/blob/master/text/2476-clippy-uno.md#stability-guarantees
299+
[rfc_lint_cats]: https://github.com/rust-lang/rfcs/blob/master/text/2476-clippy-uno.md#lint-audit-and-categories
300+
[triage]: https://forge.rust-lang.org/triage-procedure.html
301+
[l-crash]: https://github.com/rust-lang/rust-clippy/labels/L-crash%20%3Aboom%3A
302+
[l-bug]: https://github.com/rust-lang/rust-clippy/labels/L-bug%20%3Abeetle%3A

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
We are currently in the process of discussing Clippy 1.0 via the RFC process in https://github.com/rust-lang/rfcs/pull/2476 . The RFC's goal is to clarify policies around lint categorizations and the policy around which lints should be in the compiler and which lints should be in Clippy. Please leave your thoughts on the RFC PR.
2-
31
# Clippy
42

53
[![Build Status](https://travis-ci.org/rust-lang/rust-clippy.svg?branch=master)](https://travis-ci.org/rust-lang/rust-clippy)
@@ -9,7 +7,7 @@ We are currently in the process of discussing Clippy 1.0 via the RFC process in
97

108
A collection of lints to catch common mistakes and improve your [Rust](https://github.com/rust-lang/rust) code.
119

12-
[There are 290 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html)
10+
[There are 289 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html)
1311

1412
We have a bunch of lint categories to allow you to choose how much Clippy is supposed to ~~annoy~~ help you:
1513

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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ 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
30+
31+
# Add bin to PATH for windows
32+
PATH=$PATH:$(rustc --print sysroot)/bin
2933

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

0 commit comments

Comments
 (0)