Commit Graph

2004 Commits

Author SHA1 Message Date
Philipp Hansch
c4b08a5b0c
s/file_map/source_map 2018-11-22 07:53:59 +01:00
Wayne Warren
1fed72bad4 Address 'clippy::single-match' dogfood lint 2018-11-21 07:52:02 -06:00
Philipp Krones
d4a6ee4a0c Fix nit
Co-Authored-By: waynr <wayne.warren.s@gmail.com>
2018-11-21 07:52:02 -06:00
Wayne Warren
cb5e327c58 Address travis CI lint failure 2018-11-21 07:52:02 -06:00
Wayne Warren
92f7f9061c issue#3318 run trivially_copy_pass_by_ref for traits 2018-11-21 07:52:02 -06:00
Matthias Krüger
4aae76464c rustup https://github.com/rust-lang/rust/pull/52591 2018-11-21 13:29:23 +01:00
bors[bot]
64ff255ac6 Merge #3432
3432: match_ref_pats: don't emit suggestions inside of a macro r=Manishearth a=flip1995

Fixes #2636 

Co-authored-by: flip1995 <hello@philkrones.com>
2018-11-19 21:07:49 +00:00
Matthias Krüger
3a11cd4289 remove unused allow() attributes, NFC 2018-11-17 13:47:46 +01:00
flip1995
1000fc5120
Don't emit suggestion when inside of a macro 2018-11-15 17:03:17 +01:00
Matthias Krüger
2d0d41ff29 rustup https://github.com/rust-lang/rust/pull/55852/ 2018-11-15 16:50:28 +01:00
bors[bot]
a2c9d10da5 Merge #3419
3419: Linter to check that all common metadata is included r=flip1995 a=ysimonson

Addresses https://github.com/rust-lang-nursery/rust-clippy/issues/1793

This is not ready to be merged yet. First the associated changes to `cargo_metadata` need to be merged: https://github.com/oli-obk/cargo_metadata/pull/55

Co-authored-by: Yusuf Simonson <simonson@gmail.com>
2018-11-15 14:18:12 +00:00
Anton
93324f1acf
Fix "too" -> "foo" typo in format.rs 2018-11-14 14:08:52 +01:00
Michael Wright
3ba4c3a9b1 Fix use_self violation 2018-11-14 08:43:35 +02:00
Michael Wright
e2e892b59b Fix wrong suggestion for redundant_closure_call
Fixes #1684
2018-11-14 08:01:39 +02:00
Yusuf Simonson
866caabb7a Check for common metadata 2018-11-13 08:43:30 -05:00
Michael Wright
5ade9ff44e Fix use_self false positive on use statements 2018-11-13 06:15:33 +02:00
Michael Wright
460c2b317b Fix use_self false positive
This fixes the first error reported in issue #3410.
2018-11-10 10:57:11 +02:00
Michael Wright
c20e17f8ee Remove + from has_unary_equivalent
Rust doesn't has a unary + operator!
2018-11-06 07:05:13 +02:00
Michael Wright
2353f24095 Merge branch 'master' into fix-missing-comma-fp 2018-11-06 07:00:54 +02:00
Philipp Hansch
90f31e21ab
RIIR update lints: Add check mode (update_lints.py rewrite complete)
This finishes up the rewrite of `update_lints.py` in Rust. More
specifically, this

* adds the `--check` flag and handling to clippy_dev
* tracks file changes over the different calls to `replace_region_in_file`
* only writes changes to files if the `--check` flag is *not* used
* runs `./util/dev update_lints --check` on CI instead of the old script
* replaces usage of the `update_lints.py` script with an error

`./util/dev update_lints` behaves 99% the same as the python script.
The only difference that I'm aware of is an ordering change to
`clippy_lints/src/lib.rs` because underscores seem to be sorted
differently in Rust and in Python.

🏁
2018-11-05 07:18:47 +01:00
bors[bot]
7e417d4cbd Merge #3353
3353: float support added for mistyped_literal_suffixes lint r=mikerite a=Maxgy

I implemented the mistyped_literal_suffixes lint for float literals.

```
#![allow(unused_variables)]

fn main() {
    let x = 1E2_32;
    let x = 75.22_64;
}
```
Given the above, the additional check suggests the variables to be written as `let x = 1E2_f32` and `let x = 75.22_f64`.

Fixes #3167 

Co-authored-by: Maxwell Anderson <maxwell.brayden.anderson@gmail.com>
2018-11-05 03:58:15 +00:00
Matthias Krüger
396701613e rustup https://github.com/rust-lang/rust/pull/55665 (pass contexts by reference) 2018-11-04 22:47:20 +01:00
Maxwell Anderson
3e0de1745d changed into_iter to iter and fixed a lint check 2018-11-04 10:39:54 -07:00
Michael Wright
a3ab512576 Fix collapsible_if error 2018-11-04 10:48:24 +02:00
Michael Wright
0c1ffc1d1f Fix possible_missing_comma false positives
`possible_missing_comma` should only trigger when the binary operator has
unary equivalent. Otherwise, it's not possible to insert a comma without
breaking compilation. The operators identified were `+`, `&`, `*` and `-`.

This fixes the specific examples given in issues #3244 and #3396
but doesn't address the conflict this lint has with the style of starting
a line with a binary operator.
2018-11-04 10:02:49 +02:00
Matthias Krüger
b59b60c8ae rustup https://github.com/rust-lang/rust/pull/55330/ 2018-11-03 18:50:23 +01:00
bors[bot]
486300b89d Merge #3400
3400: Fix a false-positive of needless_borrow r=phansch a=sinkuu



Co-authored-by: Shotaro Yamada <sinkuu@sinkuu.xyz>
2018-11-03 08:34:13 +00:00
flip1995
cadb367a5c
Also lint cfg_attr(.., rustfmt::skip) 2018-11-02 19:50:24 +01:00
flip1995
a770d8edd0
Differ between inner and outer attributes 2018-11-02 19:49:58 +01:00
flip1995
e1cf160e2a
Add cfg_attr(rustfmt) lint 2018-11-02 19:49:57 +01:00
kennytm
5563bd6cc3
Addressed comments. 2018-11-02 22:53:57 +08:00
kennytm
2b2acf1002
Fix dogfood error. 2018-11-02 22:53:57 +08:00
kennytm
2d1c9313b0
Added lints into_iter_on_ref and into_iter_on_array. Fix #1565. 2018-11-02 22:53:56 +08:00
flip1995
32396f6e18
Allow single_match_else 2018-11-02 14:00:46 +01:00
flip1995
014cf3d6e0
Fix typos 2018-11-02 13:49:10 +01:00
flip1995
cf89c40e34
Fix dogfood error 2018-11-02 13:49:10 +01:00
flip1995
ea4a80f215
Fix typo and indentation 2018-11-02 13:49:10 +01:00
flip1995
f6d57862c7
Add new lint: unknwon_clippy_lintsg 2018-11-02 13:49:09 +01:00
Matthias Krüger
df7cff31dc clippy: fix pedantic warnings and run clippy::pedantic lints on the codebase.
Turn on pedantic lints in dogfood and base tests.

needless_bool: fix clippy::items-after-statements
redundant_pattern_matching: fix clippy::similar-names
mods.rs: fix clippy::explicit-iter-loop
returns.rs: allow clippy::cast-possible-wrap

Fixes #3172
2018-11-02 12:16:43 +01:00
bors[bot]
7c86a9c05c Merge #3387
3387: Replace big if/else expression with match r=flip1995 a=mikerite



Co-authored-by: Michael Wright <mikerite@lavabit.com>
2018-11-02 07:58:00 +00:00
Shotaro Yamada
d4370f8b07 Fix a false-positive of needless_borrow 2018-11-02 15:58:54 +09:00
bors[bot]
0ad5b9b9e0 Merge #3388
3388: RIIR update lints: Generate deprecated lints r=phansch a=phansch

The update script now also generates the 'register_removed' section in
`clippy_lints/src/lib.rs`.

Also, instead of using `let mut store ...`, I added a new identifier
line so that the replacement will continue to work in case `let mut
store ...` ever changes.

cc #2882

Co-authored-by: Philipp Hansch <dev@phansch.net>
2018-11-02 06:29:40 +00:00
Maxwell Anderson
b6b97e5c1f format code 2018-11-01 15:43:40 -06:00
Maxwell Anderson
6c1f89e8dc Merge remote-tracking branch 'upstream/master' 2018-11-01 15:26:38 -06:00
Philipp Hansch
beb44ef6ca
Fix clippy build failure on latest master 2018-11-01 20:35:23 +01:00
Maxwell Anderson
02340cc891
fix comment spacing 2018-11-01 12:35:01 -06:00
Michael Wright
0a41dfd946 Use slice patterns instead of padding 2018-11-01 07:06:47 +02:00
Maxwell Anderson
98ce3348d9 change single char str to char 2018-10-31 18:09:56 -06:00
Maxwell Anderson
3c22b2314c Merge remote-tracking branch 'upstream/master' 2018-10-31 16:48:47 -06:00
Maxwell Anderson
f4b919cad7 add lint to lintarray macro 2018-10-31 16:48:24 -06:00