bors [Fri, 5 Mar 2021 21:10:52 +0000 (21:10 +0000)]
Auto merge of #6848 - matthiaskrgr:lintcheck_clippyfix, r=llogiq
lintcheck: add --fix mode which tries to apply lint suggestions to th…
…e sources and prints a warning if that fails
Great for spotting false positives/broken suggestions of applicable lints.
There are false positives though because I'm not sure yet how to silence rustc warnings while keeping clippy warnings.
Sometimes rustc makes a suggestion that fails to apply and the implementation does not differentiate between clippy and rustc warnings when applying lint suggestions.
Matthias Krüger [Fri, 5 Mar 2021 08:30:12 +0000 (09:30 +0100)]
lintcheck: add --fix mode which tries to apply lint suggestions to the sources and prints a warning if that fails
Great for spotting false positives/broken suggestions of applicable lints.
There are false positives though becasue I'm not sure yet how to silence rustc warnings while keeping clippy warnings.
Sometimes rustc makes a suggestion that fails to apply and the implementation does not differenciate between clippy and rustc warnings when applying lint suggestions.
As far as I can tell there aren't any negative effects on other lints. These blocks only happen to be the same for a given compilation, not all compilations.
changelog: Fix `match_on_same_arms` and others. Only consider empty blocks equal if the tokens contained are the same.
bors [Wed, 3 Mar 2021 21:26:24 +0000 (21:26 +0000)]
Auto merge of #6825 - djc:naive-bytecount-pedantic, r=Manishearth
Move naive_bytecount to pedantic
As discussed on Zulip, current best practice is to avoid recommending
external crates. This lint is from before that was enforced. Move it
to the pedantic group to avoid enabling it by default.
bors [Wed, 3 Mar 2021 10:34:22 +0000 (10:34 +0000)]
Auto merge of #6824 - Y-Nak:refactor_loops_module, r=flip1995
Refactor: organize loops file into loops module (Delegated)
`@flip1995` `@nahuakang`
closes #6693
r? `@flip1995`
As we talked about in the PM of Zulip, this PR is a delegated PR from `@nahuakang.`
Changes from the last commit of #6693:
1. Unify the name of the main entries of all modules to check, that was pointed out [here](https://github.com/rust-lang/rust-clippy/pull/6693#discussion_r582897713)
2. Simplify ` check_for_loop_arg`, that was pointed out [here](https://github.com/rust-lang/rust-clippy/pull/6693#discussion_r582914044) and [here](https://github.com/rust-lang/rust-clippy/pull/6693#discussion_r582929910)
3. Resolve conflicts
changelog: Refactor `loops.rs` file into `loops` module.
changelog: Fix false positives for `manual_map` when `return`, `break`, `continue`, `yield`, `await`, and partially moved values are used.
changelog: Don't expand macros in suggestions for `manual_map`
Dirkjan Ochtman [Tue, 2 Mar 2021 13:26:23 +0000 (14:26 +0100)]
Move naive_bytecount to pedantic
As discussed on Zulip, current best practice is to avoid recommending
external crates. This lint is from before that was enforced. Move it
to the pedantic group to avoid enabling it by default.
bors [Tue, 2 Mar 2021 09:44:03 +0000 (09:44 +0000)]
Auto merge of #6716 - magurotuna:refactor-transmute-mod, r=flip1995
Refactor: arrange transmute lints
This PR arranges `transmute` lints so that they can be accessed more easily.
Basically, I followed the instruction described in #6680 as to how to do the refactoring.
- `declare_clippy_lint!` and `impl LintPass` is placed in `transmute/mod.rs`
- Uitlity functions is placed in `transmute/utils.rs`
- Each lint function about `transmute` is moved into its own module, like `transmute/useless_transmute.rs`
For ease of review, I refactored step by step, keeping each commit small. For instance, all I did in 2451781 was to move `useless_transmute` into its own module.
---
changelog: Refactor `transmute.rs` file into `transmute` module.
bors [Tue, 2 Mar 2021 08:57:11 +0000 (08:57 +0000)]
Auto merge of #6822 - camsteffen:rustfmt, r=llogiq
Rustfmt version "Two"
changelog: none
This enables some ~bug fixes~ changes from rustfmt. This is more consistent with rustc's config, and should be more forward-compatible. Also, the changes look good IMO. 😃
bors [Mon, 1 Mar 2021 11:37:08 +0000 (11:37 +0000)]
Auto merge of #6813 - matthiaskrgr:lintcheck_refactor, r=flip1995
lintcheck, do some refactoring and add more sources
refactor: add a Config object
don't run in parallel mode by default (it didn't make sense because cargo would lock the shared target dir anyway)
show full paths (from repo root) to the source files in clippy warnings so we can just copy the path from the logfile
fix more bugs
add more crates by dtolnay and embark to the sources toml
changelog: lintcheck: refactor some code and add more sources
Matthias Krüger [Sun, 28 Feb 2021 01:07:01 +0000 (02:07 +0100)]
lintcheck: more fixes
fix a couple of issues when checking if lintcheck needed rerun after clippy binary changed.
I was apparently still comparing the times wrongly, but it should be fixed™ now...
I actually looked at the date of the sources.toml and not at the date of the log file!
Also fix progress report counter not advancing in squential mode
The test reads through all the .stderr files in the testsuit and checks lint messages that start with "help: ", "error: " etc.
There is also an exception list for special messages that are deemed acceptable.
changelog: make sure lint messages conform with the rustc dev guide and add test
The test reads through all the .stderr files in the testsuit and checks lint messages that start with "help: ", "error: " etc.
There is also an exception list for special messages that are deemed acceptable.
changelog: make sure lint messages conform with the rustc dev guide and add test