Reassign default private
changelog: fix field_reassign_with_default false positive
* Fix#6344
* Fix assumption that `field: Default::default()` is the same as `..Default::default()`
* Cleanup some redundant logic
ISSUE_TEMPLATE: add templates for false negative and false positive tickets.
These will add the correct labels automatically so we don't have to do that ourselves :)
changelog: none
fix ci on master branch; run the --fix test in the correct directory
Turned out the --fix test was run in the wrong directory.
*Please write a short comment explaining your change (or "none" for internal only changes)*
changelog: none
ci: test cargo clippy --fix -Zunstable-options
Make sure we catch cases like https://github.com/rust-lang/rust-clippy/issues/6487 in CI in the future.
---
*Please write a short comment explaining your change (or "none" for internal only changes)*
changelog: none
readme: remove paragraph about executing clippy via "cargo run .."
This most likely no longer works since we are pinning clippy on a specific nightly now.
"cargo run" would try to compile clippy with whatever version the project we want to check demands.
Also building clippy yourself to run it on a project is not really needed anymore since clippy is shipped with official rust releases.
Fixes#6489
changelog: none
Added from_over_into lint
Closes#6456
Added a lint that searches for implementations of `Into<..>` and suggests to implement `From<..>` instead, as it comes with a default implementation of `Into`. Category: style.
changelog: added `from_over_into` lint
This most likely no longer works since we are pinning clippy on a specific nightly now.
"cargo run" would try to compile clippy with whatever version the project we want to check demands.
Also building clippy yourself to run it on a project is not really needed anymore since clippy is shipped with official rust releases.
Fixes#6489
Don't trigger large_enum_variant in external macros
Closes#1776 (the potential JSON output issue is not something we can fix in Clippy and I can't reproduce it anymore)
changelog: Don't trigger [`large_enum_variant`] in external macros
readme: remove paragraph about installing clippy manually on ci, if it is missing on a nightly
Clippy should always be available on nightly because we are gating on it in rustcs CI.
changelog: remove outdated readme paragraph
Adapted the website search for better matching
* This adds the ability to search for ids with dashes and spaces in the name.
* Example: `missing-errors-doc` and `missing errors doc` are now valid aliases for lint names
* It also improves the fuzzy search in the description. This search will now match any lint that where all searched words are inside the description.
* Example: `doc section` finds two lints in our selection
This was suggested/discussed on [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/Enable.20lint.20search.20with.20dashes/near/220469464)
### Testing
These changes can be tested locally by:
1. Clone this branch
2. Download the current lint index from the [gh-pages branch](https://github.com/rust-lang/rust-clippy/blob/gh-pages/master/lints.json)
3. Put it next to the `util/gh-pages/index.html` and open the html file. Make sure that it can load the lint data. (Browsers can be a bit iffy when opening a loacl html page and loading data)
### Note
I found that searching only a few characters (< 3) seams slow and deleting one even more as almost every lint description contains them. This also happens in our current [lint list](https://rust-lang.github.io/rust-clippy/master/index.html). We could change the search to only be triggered if the search field contains more than 3 letters to slightly improve performance.
---
changelog: Adapted the website search for better matching
Lint also in trait def for `wrong_self_convention`
Extends `wrong_self_convention` to lint also in trait definition.
By the way, I think the `wrong_pub_self_convention` [example](dd826b4626/clippy_lints/src/methods/mod.rs (L197)) is misleading.
On [playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=32615ab3f6009e7e42cc3754be0ca17f), it fires `wrong_self_convention`, so the example (or the lint maybe?) needs to be reworked.
The difference with `wrong_self_convention` [example](dd826b4626/clippy_lints/src/methods/mod.rs (L172)) is mainly the `pub` keyword on the method `as_str`, but the lint doesn't use the function visibility as condition to choose which lint to fire (in fact it uses the visibility of the impl item).
fixes: #6307
changelog: Lint `wrong_self_convention` lint in trait def also
UI Tests: Separate suspicious_else_formatting tests
Was briefly looking into https://github.com/rust-lang/rust-clippy/issues/3864 when I saw that the tests could benefit from being in their own file.
---
changelog: none
Fix blessing of new reference files
Adding of new reference files wasn't handled correctly. It was trying to
read a file that didn't exist yet.
Instead of unwrapping, we now treat a missing reference file as empty
(`Vec::new`). This makes the following conditional work. We then also
have to re-read the reference file after it was being copied. This
second read is technically the same as in the old shell script, but
wasn't really obvious there. The shell script did a `-s` test which
reads the file as well.
changelog: internal: Fix `cargo dev bless` when new reference files are added