Commit Graph

190 Commits

Author SHA1 Message Date
Georgiy Komarov
2dba787c90
Update URLs in Type Checking 2024-01-05 12:54:53 -03:00
bors
ee8bfb7f7a Auto merge of #12051 - y21:option_as_ref_cloned, r=dswij
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`]
2024-01-05 06:39:46 +00:00
bors
0bf0b88035 Auto merge of #12025 - jetlime:master, r=flip1995
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.
2024-01-04 10:48:53 +00:00
Paul Houssel
89e4b7162c
Include GitLab in the CI section of the clippy doc book 2024-01-04 11:43:38 +01:00
bors
691d4e275a Auto merge of #12023 - waywardmonkeys:ci-update-checkout-action, r=flip1995
ci: Update to `actions/checkout@v4` from `v3`.

This also updates the book's section on CI for the same thing.

changelog: none
2024-01-04 10:28:38 +00:00
y21
5960107415 new lint: option_as_ref_cloned 2024-01-03 19:40:47 +01:00
Yuxiang Qiu
88541d6637
fix some typos 2024-01-02 19:21:51 -05:00
Parker Timmerman
fa7dd1c4e0
add new lint, pub_underscore_fields
- 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`
2023-12-29 11:44:34 +01:00
Bruce Mitchener
4c64d7cea2 ci: Update to actions/checkout@v4 from v3.
This also updates the book's section on CI for the same thing.

changelog: none
2023-12-26 18:43:16 -05:00
Bruce Mitchener
f48b850c65 [doc_markdown]: Add "WebGL2", "WebGPU" to default doc_valid_idents 2023-12-26 16:58:43 -05:00
Samuel Tardieu
a7c59aba20 TypeckResults::node_type() can be used inside of bodies 2023-11-26 22:30:16 +01:00
Alex Macleod
7093444bfa Use absolute path for declare_tool_lint in declare_clippy_lint 2023-11-25 17:45:27 +00:00
Matthias Richter
c18e6abdca Add documentation update hint
This adds a hint to update the documentation in the book after changing the lint configuration
2023-11-23 01:38:56 +01:00
bors
c24784ed81 Auto merge of #11757 - matthri:iter-kv-map-msrv-fix, r=Alexendoo
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
2023-11-22 20:39:44 +00:00
Matthias Richter
a20f61b194 add iter_kv_map to msrv config 2023-11-22 15:19:18 +01:00
Guillaume Gomez
abd9deb9f4 [missing_safety_doc], [unnecessary_safety_doc], [missing_panics_doc], [missing_errors_doc]: Added the [check-private-items] configuration to enable lints on private items.
[#11842](https://github.com/rust-lang/rust-clippy/pull/11842)
2023-11-21 11:42:42 +01:00
Alex Macleod
f1979d48d7 Destructure Conf in register_lints 2023-11-10 23:47:52 +00:00
y21
b9efa3ee2c update references of clippy_utils::msrvs and clippy_lints::util::conf 2023-11-04 01:15:32 +01:00
Alex Macleod
7df1c8aa78 Hide config implementation details from public docs 2023-10-24 11:52:17 +00:00
Alex Macleod
4622203c9b Move configuration to new clippy_config crate 2023-10-23 20:05:10 +00:00
Alex Macleod
7347c1803f Set existing doc-tests to no_run 2023-10-23 15:28:26 +00:00
bors
9574d28cb6 Auto merge of #11683 - Alexendoo:msrv-config, r=Manishearth,flip1995
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
2023-10-19 11:51:08 +00:00
Alex Macleod
1528c1db47 Deserialize Msrv directly in Conf 2023-10-18 20:35:09 +00:00
jonboh
8b02dac542 add lint for struct field names
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
2023-10-18 19:20:08 +02:00
Caio
8c0870de7f Address comment 2023-10-13 10:31:02 -03:00
Caio
d1796054fe Document conflicting lints 2023-10-13 10:09:58 -03:00
Michael Schubart
0f8b8625bd Fix documentation link
The file pointed to by the old link

557f6848bd/clippy_lints/src/lib.rs (L110)

did not talk about categories and levels.

The new link (hopefully) points here

https://doc.rust-lang.org/stable/clippy/

which has a nice table explaining the mappings.
2023-10-01 16:44:30 +01:00
Alex Macleod
ec2f62677f Add manual_hash_one lint 2023-09-26 13:49:15 +00:00
Trevor Gross
1b3e5dd0fc Change default configuration of undocumented_unsafe_blocks
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.
2023-09-20 03:41:33 -04:00
y21
981e96008b new lint: path_ends_with_ext 2023-09-15 16:17:51 +02:00
bors
60a18b7831 Auto merge of #11449 - blyxyas:book-write_tests, r=flip1995
Should be final writing_tests commit

Fixes that book `FIXME`.

r? `@flip1995`
changelog: none
2023-09-03 20:25:41 +00:00
bors
b65e544535 Auto merge of #10626 - blyxyas:book-trait_checking, r=flip1995
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
2023-09-02 11:21:48 +00:00
blyxyas
92d47dbb29
Add emitting_lints link to Writing tests and remove that FIXME 2023-09-02 12:26:13 +02:00
bors
3cf1087dcd Auto merge of #10598 - blyxyas:book-emit_lints, r=flip1995
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`
2023-09-02 09:49:57 +00:00
blyxyas
a26937ff0e
Fix links 2023-09-02 11:46:20 +02:00
bors
aa371eb154 Auto merge of #10596 - blyxyas:book-write_tests, 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`
2023-09-02 09:34:16 +00:00
blyxyas
e1a3f635fc
Apply suggestion 2023-09-02 11:23:27 +02:00
Ben Schofield
55bd0fe296 Fix metadata collection 2023-08-30 16:02:37 -07:00
Philipp Krones
8ee6ca0981
Update rustfix section to new ui-test crate 2023-08-18 20:16:26 +02:00
Philipp Krones
9b8b83556b
Formatting and minor wording fixes 2023-08-18 19:55:01 +02:00
Philipp Krones
32dc7c592d
Applying review suggestions 2023-08-18 19:28:41 +02:00
Philipp Krones
864df49bd3
Formatting, slimming and ui-toml tests 2023-08-18 19:18:15 +02:00
blyxyas
289bafa3e0
New chapter: Writing tests
Co-authored-by: Nahua <kangnahua@gmail.com>
2023-08-17 22:58:26 +02:00
blyxyas
2a3f75b0b8
Fix CI 2023-08-17 22:56:39 +02:00
blyxyas
b2e1ede39c
Change Tokio example description to Core 2023-08-17 22:56:39 +02:00
blyxyas
94387efc83
Fixes based on reviews 2023-08-17 22:56:38 +02:00
blyxyas
3c50a0a18d
Add new chapter: "Trait Checking" 2023-08-17 22:56:37 +02:00
Philipp Krones
1dbc8dd0cf
Fix define_lints->defining_lints typo in link 2023-08-16 14:54:47 +02:00
Philipp Krones
e8d79b8645
Formatting 2023-08-16 14:50:40 +02:00
blyxyas
9e4a2d7fca
Fixes based on reviews 2023-08-16 14:50:40 +02:00