bors [Tue, 14 Jun 2022 16:54:13 +0000 (16:54 +0000)]
Auto merge of #8999 - Alexendoo:error-pattern, r=xFrednet
Remove error-pattern comments
The `clippy_lints` one [is unused](https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/.60error-pattern.60), the others in `ui-toml` also appear not to have an effect
bors [Tue, 14 Jun 2022 08:59:40 +0000 (08:59 +0000)]
Auto merge of #8901 - Jarcho:sharing_code, r=dswij
Rework `branches_sharing_code`
fixes #7378
This changes the lint from checking pairs of blocks, to checking all the blocks at the same time. As such there's almost none of the original code left.
changelog: Don't lint `branches_sharing_code` when using different binding names
bors [Mon, 13 Jun 2022 08:21:54 +0000 (08:21 +0000)]
Auto merge of #8988 - xFrednet:8947-test-monster-in-bors-ci, r=flip1995
Test metadata collection in Bors CI workflow
This PR adds a new check to bors CI workflows, which ensures that the metadata collection success, when it's run as part of the `deploy` script. I've only added it to bors workflows, as the runtime will be high while it'll also succeed most of the time. This is a preparation for rust-lang/rust-clippy#8947.
bors [Thu, 9 Jun 2022 11:03:49 +0000 (11:03 +0000)]
Auto merge of #8954 - Serial-ATA:doc-comment-issues, r=xFrednet
Improve lint doc consistency
changelog: none
This is a continuation of #8908.
Notable changes:
- Removed empty `Known Problems` sections
- Removed "Good"/"Bad" language (replaced with "Use instead")
- Removed (and added some :smile:) duplication
- Ignored the [`create_dir`] example so it doesn't create `clippy_lints/foo` :smile:
Jason Newcomb [Tue, 7 Jun 2022 04:40:32 +0000 (00:40 -0400)]
Changes to `iter_overeager_cloned`
* Don't lint on `.cloned().flatten()` when `T::Item` doesn't implement `IntoIterator`
* Reduce verbosity of lint message
* Narrow down the scope of the replacement range
bors [Mon, 6 Jun 2022 16:53:37 +0000 (16:53 +0000)]
Auto merge of #7359 - joshrotenberg:clippy_guide, r=xFrednet
Clippy book
A work in progress Clippy Book using mdbook. See #6011.
This is currently just a moving around of things:
1. The current README.md split up a bit and put into sections.
1. A rough outline of Clippy lint categories (currently no content, potentially add a basic introduction for each and some example, see questions below.
1. The `docs` content repurposed into a top level `Development` section.
1. The current Roadmap.
Some big questions:
1. is `guide/` the right place? I'm modeling after mdbook itself.
1. What is the relationship between ALL the Clippy Lints and this guide? It seems like they can coexist. Does that mean the guide should just point to the current side with regard to actual lints, and maybe just include some examples to keep it interesting? Keeping both up to date seems like a maintenance nightmare unless its automated somehow. Or should the current ALL the Clippy lints somehow be incorporated into the book?
1. Related to the above, where should this guide be published since the `gh-pages` branch is already in use?
1. This PR doesn't currently change any existing content. Obviously that would make sense assuming the general structure and relocation is an acceptable approach.
---
Open Tasks for follow up PR:
- Set up CI/CD
- Split up Installation and Usage
- Add more content to Usage (and Installation) chapters
- Enhance CI chapter with more examples for different CIs
---
changelog: The first version of the *Clippy Book*
staring, *The Clippy Team*, *Bors* and *rustc*
bors [Mon, 6 Jun 2022 16:34:27 +0000 (16:34 +0000)]
Auto merge of #8944 - xFrednet:8877-append-doc-idents, r=Manishearth
List configuration values can now be extended instead of replaced
I've seen some `clippy.toml` files, that have a few additions to the default list of a configuration and then a copy of our default. The list will therefore not be updated, when we add new names. This change should make it simple for new users to append values instead of replacing them.
I'm uncertain if the documentation of the `".."` is apparent. Any suggestions are welcome. I've also check that the lint list displays the examples correctly.
<details>
<summary>Lint list screenshots</summary>
changelog: enhancement: [`doc_markdown`]: Users can now indicate, that the `doc-valid-idents` should extend the default and not replace it
changelog: enhancement: [`blacklisted-name`]: Users can now indicate, that the `blacklisted-names` should extend the default and not replace it
Closes: #8877
That's it. Have a fantastic weekend to everyone reading this. Here is a cookie :cookie:
Philipp Krones [Mon, 6 Jun 2022 11:25:11 +0000 (13:25 +0200)]
Book: Improve sync documentation
- Move doc about defining remotes to the front and use the defined
remotes in the further documentation
- Don't recommend pushing to the remote repo directly
- Add some clarifying comments
This removes the empty separate files for the different groups and adds
a single file giving short explanations for each group and what to
expect from those groups.
flip1995 [Fri, 21 Jan 2022 16:29:18 +0000 (17:29 +0100)]
Remove Edition 2018 tests section from adding lints doc
The UI tests now use the latest edition by default. Testing on older
editions should almost never be necessary, so I don't see a need to
document this.
flip1995 [Fri, 21 Jan 2022 16:27:57 +0000 (17:27 +0100)]
Reformat internal docs
This reformats all the internal docs, so that the md files use at most
80 characters per line. This is the usual formatting of md files. We
allow 120 chars per line in CI though.
Michael Wright [Sun, 5 Jun 2022 05:28:28 +0000 (07:28 +0200)]
needless_late_init refactoring
Remove the unneeded wrapping and unwrapping in suggestion creation.
Collecting to Option<Vec<_>> only returns None if one of the elements is
None and that is never the case here.
bors [Fri, 3 Jun 2022 19:24:53 +0000 (19:24 +0000)]
Auto merge of #8934 - DevAccentor:as_underscore, r=Manishearth
add [`as_underscore`] lint
closes #8847
detect usage of `as _` and enforce the usage of explicit type like
```rust
fn foo(n: usize) {}
let n: u16 = 256;
foo(n as _);
```
will suggest to change to
```rust
fn foo(n: usize) {}
let n: u16 = 256;
foo(n as usize);
```