Commit graph

2866 commits

Author SHA1 Message Date
daxpedda
0ee393cf01
Add tests and improve checks. 2020-02-17 14:43:38 +01:00
Krishna Sai Veera Reddy
552452873c Add tests for lossy whole number float literals 2020-02-17 00:05:50 -08:00
Yuki Okushi
09165ff576 Don't lint single_component_path_imports in macros 2020-02-17 11:13:42 +09:00
Yuki Okushi
f77158bc14 Fix false positive in zero_prefixed_literal 2020-02-13 14:39:29 +09:00
flip1995
b47dada167
Apply review comments 2020-02-12 09:34:28 +01:00
flip1995
095287dbc8
Add two more error causes to integration test 2020-02-12 09:34:27 +01:00
flip1995
1717a6f7d5
Ignore fmt test in GHA CI
This is already checked by clippy_dev.yml GHA
2020-02-12 09:34:26 +01:00
Krishna Sai Veera Reddy
fcc3e7238f Remove unnecessary imports from tests 2020-02-11 06:20:47 -08:00
Philipp Krones
c86c09b19a
Use current_dir instead of cargo_metadata
Co-Authored-By: lzutao <taolzu@gmail.com>
2020-02-10 16:42:50 +01:00
flip1995
f940b04de6
Fix run-pass tests when CARGO_TARGET_DIR is not set 2020-02-10 15:51:51 +01:00
bors
c066807a70 Auto merge of #5148 - krishna-veerareddy:issue-5147-option-env-unwrap, r=flip1995
Add `option-env-unwrap` lint

changelog: Add `option-env-unwrap` lint

Fixes #5147
2020-02-10 08:08:53 +00:00
Krishna Sai Veera Reddy
b48b221f80 Use PATH environment variable for testing
The tests were failing on windows because the `HOME` env variable
doesn't exist on it so using the `PATH` variable to test instead.
2020-02-09 15:35:51 -08:00
Krishna Sai Veera Reddy
a3a1587a1c Allow option-env-unwrap within external macros 2020-02-09 10:58:08 -08:00
Krishna Sai Veera Reddy
0e5ba2f0e7 Account for expect being used to unwrap Option 2020-02-09 08:54:23 -08:00
Lzu Tao
9eb913a7e2 Fix error E0460 when compiled on Rustc repo 2020-02-09 19:02:27 +07:00
Krishna Sai Veera Reddy
be1bc571c3 Add option-env-unwrap lint 2020-02-08 16:44:35 -08:00
Lzu Tao
9a12baad35 Update CARGO_TARGET_DIR 2020-02-07 14:41:04 +07:00
Lzu Tao
c6a4beaf56 Rustup https://github.com/rust-lang/rust/pull/67359 2020-02-07 10:40:09 +07:00
bors
b5e6d6db41 Auto merge of #5134 - flip1995:snippet_block, r=phansch
Make it possible to correctly indent snippet_block snippets

This adds a `indent_relative_to` arg to the `{snippet,expr}_block` functions. This makes it possible to keep the correct indentation of block like suggestions.

In addition, this makes the `trim_multiline` function private and adds a `indent_of` function, to get the indentation of the first line of a span.

The suggestion of `needless_continue` cannot be made auto applicable, since it would be also necessary to remove code following the linted expression. (Well, maybe it is possible, but I don't know how to do it. Expanding the suggestion span to the last expression, that should be removed didn't work)

changelog: Improve suggestions, when blocks of code are involved
2020-02-06 21:41:50 +00:00
flip1995
9897927504
Rustup to rust-lang/rust#68788 2020-02-06 20:33:39 +01:00
flip1995
4068ff4d8a
Improve help message in needless_continue 2020-02-06 19:15:01 +01:00
flip1995
c7979d3515
Fix rebase fallout 2020-02-06 19:15:01 +01:00
flip1995
7363728d18
Update remaining test files 2020-02-06 19:15:01 +01:00
flip1995
f1a72e992d
Update needless_continue stderr 2020-02-06 19:13:46 +01:00
flip1995
8e15985827
Rewrite suggestion generation of needless_continue 2020-02-06 19:13:46 +01:00
flip1995
10cd1662c1
Update block_in_if_condition test files 2020-02-06 19:13:46 +01:00
bors
75e983a518 Auto merge of #5125 - Areredify:too_many_bools, r=flip1995
Port mitsuhiko's excessive bools lints

Closes #4 .
changelog: add `struct_excessive_bools` and `fn_params_excessive_bools` lints.
I moved is_trait_impl_item check because at first I implemented it as a late pass for some reason but then I realized it's actually an early lint. But it's a useful function to have, should I move it into a separate pr?
2020-02-06 14:47:14 +00:00
bors
a3135ba131 Auto merge of #5132 - JohnTitor:fix-fp-in-unwrap-lint, r=flip1995
Do not lint `unnecessary_unwrap` in external macros

Fixes #5131

I think we shouldn't lint `{panicking, unnecessary}_unwrap` in macros, not just `assert!`.

changelog: Fix false positive in `unnecessary_unwrap`
2020-02-06 14:17:35 +00:00
Areredify
338fb7a3e9 add excessive bools lints 2020-02-05 20:54:58 +03:00
Lzu Tao
c4b4dd200c Use lazy_static 2020-02-05 16:13:55 +01:00
Lzu Tao
3485d22139 Add serde_derive to the need-to-be-disambiguated-crates list 2020-02-05 22:00:19 +07:00
Lzu Tao
47abd0a217 Fix dogfood to use cargo mod too 2020-02-05 21:55:03 +07:00
Lzu Tao
4c2a5f857a compile-test: Handle CARGO_TARGET_DIR and transitive deps 2020-02-05 21:55:03 +07:00
ThibsG
53094de08e Merge fixes 2020-02-04 22:53:24 +01:00
ThibsG
b29aacfec8 Add wild and struct handling 2020-02-04 22:53:24 +01:00
ThibsG
6afd7ea147 Use span_lint_and_sugg + move infaillible lint
- moving infaillible lint to prevent collisions
2020-02-04 22:49:08 +01:00
Yuki Okushi
19ce66c1c1 Re-cover use of unnecessary unwraps in macros 2020-02-05 05:38:26 +09:00
ThibsG
3445d41f07 Add new lint: match with a single binding statement
- Lint name: MATCH_SINGLE_BINDING
2020-02-04 01:06:16 +01:00
Yuki Okushi
514b1bc2af Do not lint unnecessary_unwrap in macros 2020-02-04 04:01:42 +09:00
Yuki Okushi
49934e70a2 Remove unnecessary comment 2020-02-04 01:29:11 +09:00
Yuki Okushi
7c5785ca2b Split up indexing_slicing ui test 2020-02-03 15:09:17 +09:00
Yuki Okushi
fa32b41365 Split up drop_forget_ref ui test 2020-02-01 20:28:27 +09:00
Matthias Krüger
187983e991 update test stderr 2020-01-31 20:21:10 +01:00
flip1995
006f07f090
Add test for await in debug_assert!(..) 2020-01-31 10:57:51 +01:00
bors
ca2abaf366 Auto merge of #5109 - phansch:ciao_util_dev, r=flip1995
Deprecate util/dev in favor of cargo alias

This means one less shell script and a bit more cross-platform support
for contributors.

If you've been using `./util/dev` before, this now becomes `cargo dev`.

The key part of this change is found in `.cargo/config` where an alias for calling the `clippy_dev` binary is defined.

changelog: none
2020-01-31 07:18:06 +00:00
bors
bbef531518 Auto merge of #5108 - JohnTitor:split-up-0130, r=flip1995
Split up `match` ui test

Part of #2038

Also, this decreases the line length limit to 220.

changelog: none
2020-01-30 21:06:47 +00:00
Philipp Hansch
4d1a11d354
Deprecate util/dev in favor of cargo alias
If you've been using `./util/dev` before, this now becomes `cargo dev`.

The key part of this change is found in `.cargo/config`.

This means one less shell script and a bit more cross-platform support
for contributors.
2020-01-30 21:34:31 +01:00
bors
668bc485da Auto merge of #5101 - Areredify:let_underscore_lock, r=flip1995
add `let_underscore_lock` lint

closes #1574
changelog: add `let_underscore_lock` lint

I am not entirely sure about my docs/messages wording here, improvements are welcome
2020-01-30 20:24:24 +00:00
Areredify
63ab7a5e8c lint all guard types, not just lock functions 2020-01-30 18:46:22 +03:00
Mikhail Babenko
9b88a2b295 decouple 'let_underscore' tests 2020-01-30 16:51:23 +03:00