new lint: `option_as_ref_cloned`
Closes#12009
Adds a new lint that looks for `.as_ref().cloned()` on `Option`s. That's the same as just `.clone()`-ing the option directly.
changelog: new lint: [`option_as_ref_cloned`]
Include GitLab in the CI section of the clippy doc book
Fixes#12012
changelog: Docs: [`Continuous Integration`] now includes how to use clippy in GitLab CI.
- add a new late pass lint, with config options
- add ui tests for both variations of config option
- update CHANGELOG.md
github feedback
bump version to 1.77 and run cargo collect-metadata
Change `,` to `;` in `conf.rs`
Fix iter_kv_map false positive into_keys and into_values suggestion
fixes: #11752
changelog: [`iter_kv_map`]: fix false positive: Don't suggest `into_keys()` and `into_values()` if the MSRV is to low
Deserialize `Msrv` directly in `Conf`
Gives the error a span pointing to the invalid config value
Also puts `Conf` itself in the `OnceLock` rather than just the `Msrv` for [the `register_late_mod_pass` work](https://github.com/rust-lang/rust/pull/116731) since it will be used from two different callbacks
changelog: none
side effect for `enum_variants`:
use .first() instead of .get(0) in enum_variants lint
move to_camel_case to str_util module
move module, enum and struct name repetitions check to a single file `item_name_repetitions`
rename enum_variants threshold config option
This patch sets the two configuration options for
`undocumented_unsafe_blocks` to `true` by default: these are
`accept-comment-above-statement` and `accept-comment-above-attributes`.
Having these values `false` by default prevents what many users would
consider clean code, e.g. placing the `// SAFETY:` comment above a
single-line functino call, rather than directly next to the argument.
changelog: [`undocumented_unsafe_blocks`]: set
`accept-comment-above-statement` and `accept-comment-above-attributes`
to `true` by default.
Clippy Book Chapter Updates Reborn: Trait Checking
This PR adds a new chapter to the book: "Trait Checking". No major changes from the source (just some typos, re-phrasing, the usual).
## Notes
- Does not require any other PR to be merged.
- To talk about the whole project, please use the tracking issue for the project #10597 (It also contains a timeline, discussions and more information)
changelog: Add a new "Trait Checking" chapter to the book
Clippy Book Chapter Updates Reborn: Emitting lints
The PR adds a new chapter to the book: "Emitting lints". This time it changed a lot from the old source file.
## Notes
- For discussion about the whole project, please use the tracking issue for the project #10597 (It also contains a timeline, discussions, and more information)
changelog: Add a new "Emitting lints" chapter to the book
r? `@flip1995`
Clippy Book Chapter Updates Reborn: Writing tests
This PR adds a new chapter to the book: "Writing tests". The changes have been mainly done from reviews from #9426 and some minor re-writes.
## Notes
- We still need to check that the `git status`es are correct, as `cargo dev new_lint` changed a lot since 2022.
- Requires #10598: Link to "Emitting Lints" where I flagged with `FIXME:`.
- To talk about the whole project, please use the tracking issue for the project #10597 (It also contains a timeline, discussions and more information)
changelog: Add a new "Writing tests" chapter to the book
r? `@flip1995`