Commit Graph

14223 Commits

Author SHA1 Message Date
bors
b3c94c0828 Auto merge of #8976 - xFrednet:rust-97660-catch-emissions-with-expect, r=Jarcho
Fix some `#[expect]` lint interaction

Fixing the first few lints that aren't caught by `#[expect]`. The root cause of these examples was, that the lint was emitted at the wrong location.

---

changelog: none

r? `@Jarcho`

cc: rust-lang/rust#97660
2022-06-09 22:28:36 +00:00
bors
65f518e06c Auto merge of #8979 - Alexendoo:version-numbers, r=flip1995
Correct some `#[clippy::version]`s

Some were a bit off

changelog: none
2022-06-09 14:02:36 +00:00
Alex Macleod
2b655d4630 Correct some #[clippy::version]s 2022-06-09 13:50:07 +00:00
bors
4970527296 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 😄) duplication
- Ignored the [`create_dir`] example so it doesn't create `clippy_lints/foo` 😄
2022-06-09 11:03:49 +00:00
Serial
649ac36836 Fix [needless_bool] example 2022-06-09 06:54:01 -04:00
xFrednet
9d201d68b4
Fix #[expect] for default_numeric_fallback 2022-06-09 09:17:46 +02:00
bors
919cf5083b Auto merge of #8907 - kyoto7250:fix_8898, r=giraffate
fix(lint): check const context

close: https://github.com/rust-lang/rust-clippy/issues/8898

This PR fixes a bug in checked_conversions.

Thank you in advance.

changelog: check const context in checked_conversions.
2022-06-09 00:04:09 +00:00
bors
50541b90e9 Auto merge of #8950 - Jarcho:derive_non_pub, r=dswij
Fixes for `derive_partial_eq_without_eq`

fixes  #8875

changelog: Don't lint `derive_partial_eq_without_eq` on non-public types
changelog: Better handle generics in `derive_partial_eq_without_eq`
2022-06-08 14:03:50 +00:00
bors
ab8c8c6081 Auto merge of #8960 - Jarcho:iter_cloned, r=giraffate
Changes to `iter_overeager_cloned`

fixes: #8494

changelog: Don't lint `iter_overeager_cloned` on `.cloned().flatten()` when `T::Item` doesn't implement `IntoIterator`
2022-06-08 00:41:05 +00:00
Serial
0e07f55ceb Hide unnecessary code in [implicit_saturating_sub] 2022-06-07 18:51:45 -04:00
Jason Newcomb
bf3ab592f0 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
2022-06-07 00:40:32 -04:00
Serial
cab5362d32 Suppress unused in doc examples 2022-06-06 20:28:16 -04:00
bors
72f5ff6903 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*
2022-06-06 16:53:37 +00:00
bors
ad70bffa9e 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>

![image](https://user-images.githubusercontent.com/17087237/171999434-393f2f83-09aa-4bab-8b05-bd4973150f27.png)

![image](https://user-images.githubusercontent.com/17087237/171999401-e6942b53-25e6-4b09-89e5-d867c7463156.png)

</details>

---

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 🍪
2022-06-06 16:34:27 +00:00
Philipp Krones
b2660de8ec
Book: Improve release documentation
Make it clear for all code blocks in which repository they should be
run. Also make sure that the correct beta commit is fetched.
2022-06-06 16:17:58 +02:00
Philipp Krones
99a731d265
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
2022-06-06 16:17:58 +02:00
Philipp Krones
9305659922
Book: Improve chapter on CI
Recommend the -Dwarnings and --all-targets/--all-features more strongly.
2022-06-06 16:17:58 +02:00
Philipp Krones
1f11cd17ac
Remove bit-rotty list of Clippy team members from CONTRIBUTING.md 2022-06-06 16:17:58 +02:00
flip1995
b551928800
Auto update lint count in Clippy book 2022-06-06 16:17:58 +02:00
flip1995
c9cbead656
Book: Add infrastructure description 2022-06-06 16:17:57 +02:00
flip1995
b37d24f7ff
Move parts of CONTRIBUTING.md to the book 2022-06-06 16:17:57 +02:00
flip1995
cbe4de2f6c
Book: Add continuous integration description 2022-06-06 16:17:57 +02:00
flip1995
6b21d386f6
Book: Add Proposals description 2022-06-06 16:17:57 +02:00
flip1995
97bceb0e31
Book: Restructure Dev chapter
Group everything that has something to do with Clippy development under
the "Development" chapter, so that Clippy users can't get confused.
2022-06-06 16:16:11 +02:00
flip1995
0e42282ed5
Book: Write lint group descriptions
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.
2022-06-06 16:16:07 +02:00
flip1995
d12a5c3a52
Book: Split up and rewrite installation and usage 2022-06-06 16:16:01 +02:00
flip1995
404432b791
Book: Update GHA doc and remove GitLab placeholder 2022-06-06 16:15:53 +02:00
flip1995
b374e0f696
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.
2022-06-06 16:15:53 +02:00
flip1995
d6b013ff9e
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.
2022-06-06 16:15:53 +02:00
flip1995
206ec6e2f6
Move syncing doc to book 2022-06-06 16:15:53 +02:00
flip1995
af385799e0
Move internal documentation to book 2022-06-06 16:15:53 +02:00
josh rotenberg
853d7eeed6
Book: add a ci chapter 2022-06-06 16:15:52 +02:00
josh rotenberg
4e6b55e9b8
Initial commit for the Clippy Book 2022-06-06 16:15:52 +02:00
xFrednet
8db734990b
Fix #[expect] for async_yields_async 2022-06-06 14:13:28 +02:00
bors
0f6e50fe1b Auto merge of #8933 - DennisOSRM:needless_braces_range_literal, r=dswij
Add new lint [`needless_parens_on_range_literals`]

changelog: Adds a new lint [`needless_parens_on_range_literals`] to warn on needless braces on literals in a range statement

For example, the lint would catch

```log
error: needless parenthesis on range literals can be removed
  --> $DIR/needless_parens_on_range_literals.rs:8:13
   |
LL |     let _ = ('a')..=('z');
   |             ^^^^^ help: try: `'a'`
   |
   = note: `-D clippy::needless-parens-on-range-literals` implied by `-D warnings`
```
2022-06-06 10:58:33 +00:00
xFrednet
7e1730e16c
Fix #[expect] for same_name_method 2022-06-06 12:36:57 +02:00
xFrednet
a613460e8a
Fix #[expect] for needless_borrow, ref_binding_to_ref 2022-06-06 11:51:36 +02:00
bors
3e771624e1 Auto merge of #8951 - mikerite:needless-late-init-20220605, r=giraffate
Some refactoring in `needless_late_init`

changelog: none
2022-06-06 00:25:14 +00:00
Dennis Luxen
61d7dd2af0 Update CHANGELOG.md 2022-06-05 22:47:29 +02:00
Dennis Luxen
8ba377a783 Fix names to use plural 2022-06-05 22:47:21 +02:00
Dennis Luxen
bf7a786481 Apply suggestions from code review
Co-authored-by: dswij <dharmasw@outlook.com>
2022-06-05 22:47:15 +02:00
Dennis Luxen
58a605f453 Rerun cargo dev update_lints 2022-06-05 22:47:08 +02:00
Dennis Luxen
c0aa1f78b4 Implement suggestion generation with snippet_with_applicability(.) 2022-06-05 22:47:01 +02:00
Dennis Luxen
0409306bb0 Implement support for implicit start and end 2022-06-05 22:46:53 +02:00
Dennis Luxen
2e6903ccf9 Move description into lint macro 2022-06-05 22:46:41 +02:00
Dennis Luxen
90c8463d7e Rewrite check to account for floating point literals 2022-06-05 22:46:34 +02:00
Dennis Luxen
5948959c7e Fix misnomer braces -> parenthesis 2022-06-05 22:46:23 +02:00
Dennis Luxen
8bc1be17d6 Update clippy_lints/src/needless_braces_on_range_literal.rs
Co-authored-by: Alex <69764315+Serial-ATA@users.noreply.github.com>
2022-06-05 22:46:11 +02:00
Dennis Luxen
3058cb941c Update clippy_lints/src/needless_braces_on_range_literal.rs
Co-authored-by: Alex <69764315+Serial-ATA@users.noreply.github.com>
2022-06-05 22:46:03 +02:00
Dennis Luxen
ba43f0aee9 Add new lint [needless_braces_on_range_literal] 2022-06-05 22:45:57 +02:00