Commit graph

86 commits

Author SHA1 Message Date
Nick Drozd
5318883d75 Use expect for lint warnings 2025-10-06 20:17:12 -04:00
Jason Newcomb
3d2a8df077 Upgrade toml to 0.9.7 and remove the serde feature. 2025-10-02 15:31:42 -04:00
Timo
e8185ec091
Extend implicit_clone to handle to_string calls (#14177)
Put another way, merge `string_to_string` into `implicit_clone`, as
suggested here:
https://github.com/rust-lang/rust-clippy/issues/14173#issuecomment-2645846915

Note: [I
wrote](b8913894a1)
this comment:
6cdb7f68c3/clippy_lints/src/methods/implicit_clone.rs (L43-L45)

Here is the context for why I wrote it:
https://github.com/rust-lang/rust-clippy/pull/7978#discussion_r769128853

Regardless, it's probably time for the comment to go away. Extending
`implicit_clone` to handle `to_string` calls yields many hits within
Clippy's codebase.

changelog: extend `implicit_clone` to handle `to_string` calls
2025-08-02 11:41:00 +00:00
Samuel Tardieu
c57876242d
Output lintcheck summary HTML markdown in order
The data in the table needs to be in the same order as the headings.
2025-07-30 09:49:27 +02:00
Philipp Krones
2ed97eb466
Create summary comment for lintcheck runs (#14816)
Previously https://github.com/rust-lang/triagebot/pull/1985

After a lintcheck run a comment will be created in the PR thread with an
overview of the changes, example here
https://github.com/Alexendoo/rust-clippy/pull/18#issuecomment-2880441316
(plus the normal GHA debugging experience)

It will only comment if there are some changes, if there's already an
existing comment it will be updated for each run

Similar to
https://github.com/rust-lang/team/blob/master/.github/workflows/dry-run.yml

The PR number is supplied by the lintcheck run, so technically someone
could forge it to be annoying and edit the summaries in other threads,
but that is pretty low impact and easy to deal with. There is a
`pull_requests` field on the event but as @Kobzol [pointed out to
me](https://github.com/rust-lang/triagebot/pull/1985#issuecomment-2869157116)
it's not populated for PRs from forks

r? @flip1995

changelog: none
2025-07-09 08:29:50 +00:00
klensy
9ed1843653 dogfood clippy::or_fun_call 2025-06-17 15:42:54 +03:00
dswij
24a2a6629d
Support different lintcheck CARGO_TARGET_DIR env variables (#14859)
Make lintcheck support different `CARGO_TARGET_DIR`, do not hardcode
`target` (useful for perf)

changelog:none
2025-05-24 16:57:47 +00:00
blyxyas
f1ad1cd799 Support different lintcheck CARGO_TARGET_DIR 2025-05-21 17:24:20 +00:00
yanglsh
520cb092b8 Apply needless_for_each to clippy itself 2025-05-20 18:07:57 +08:00
Samuel Moelius
8a9adba852 Fix adjacent code 2025-05-19 19:29:06 -04:00
Alex Macleod
2dbaf1c7be Create summary comment for lintcheck runs 2025-05-16 01:07:56 +00:00
Alex Macleod
737d3b3363 Remove some unused #![feature]s 2025-05-06 14:07:39 +00:00
Samuel Tardieu
2c021ca19a Reinstate checking of tokio-rustls in lintcheck
`cmake` has been pinned to version 3.31.6 in Ubuntu runner images.
Reference: https://github.com/actions/runner-images/pull/11933
2025-04-11 10:41:36 +02:00
Samuel Tardieu
d81396b7d0 Do not build tokio-rustls in the CI for the time being
A discrepancy between the `cmake` version available on the runners and
the one required by the `aws-lc-sys` dependency prevents the crate from
buiding.
2025-04-01 19:34:15 +02:00
Samuel Tardieu
79c69112dc Apply collapsible_if to Clippy itself
Since Clippy uses the `let_chains` feature, there are many occasions to
collapse `if` and `if let` statements.
2025-03-27 14:40:44 +01:00
dswij
4517b4260f
Fix various typos in lint messages, descriptions and comments (#14459)
changelog: none
2025-03-26 05:05:21 +00:00
Samuel Tardieu
6509de3bfb Fix situations identified by collapsible_if new hits 2025-03-25 19:50:24 +01:00
Samuel Tardieu
621911a677 Fix various typos in lint messages, descriptions and comments 2025-03-24 16:04:32 +01:00
Alex Macleod
c033a4c741
Document and improve (a lot) lintcheck --perf (#14194)
In #14116 we added a benchmarking option for Lintcheck, this commit adds
a new chapter to the book AND improves that option into a more usable
state.

It's recommended to review one commit at a time.

- **Document how to benchmark with lintcheck --perf**
- **Several improvements on lintcheck perf (desc.)**

    - Now lintcheck perf deletes target directory after benchmarking,
benchmarking with a cache isn't very useful or telling of any
precise outcome.

    - Support for benchmarking several times without having to do
a cargo clean.

    - Compress perf.data

changelog: none
2025-03-23 00:01:53 +00:00
Philipp Krones
d5a6688092
Use a lintcheck specific Clippy configuration file in the CI (#14233)
By default, lintcheck will use the `clippy.toml` file found at the
toplevel of the repository (`CARGO_MANIFEST_DIR`). This file is meant
for configuration of Clippy applied to Clippy sources.

This creates a new `lintcheck/ci-config/clippy.toml` file which is used
by the CI when running lintcheck. By default this uses the default
Clippy configuration.

changelog: none
2025-03-22 12:23:32 +00:00
blyxyas
17351bd503 Change frequency to 3000 2025-03-15 17:57:10 +01:00
Turtel216
184feee826 Fix key function description 2025-03-09 16:29:07 +02:00
Turtel216
8dd65e4098 Add documentation to json.rs module 2025-03-09 16:03:12 +02:00
Samuel Tardieu
e1d6f1fc5c Use a lintcheck specific Clippy configuration file in the CI
By default, lintcheck will use the `clippy.toml` file found at the
toplevel of the repository (`CARGO_MANIFEST_DIR`). This file is meant
for configuration of Clippy applied to Clippy sources.

This creates a new `lintcheck/ci-config/clippy.toml` file which is used
by the CI when running lintcheck. By default this uses the default
Clippy configuration.
2025-02-27 22:27:00 +01:00
Alejandra González
b583568e72
Add unnecessary_debug_formatting lint (#13893)
Fixes #12674, i.e., adds a lint to flag `Path`s printed with `{:?}`.

Nits are welcome.

changelog: Add `unnecessary_debug_formatting` lint
2025-02-26 15:03:57 +00:00
Samuel Moelius
6af901c51e Add unnecessary_debug_formatting lint
Address review comments

Fix adjacent code

Required now that the lint is pedantic

Add inline formatting tests

Add note re formatting changes

Address `unnecessary_map_or` warnings

Address additional review comments

Typo

Update Clippy version
2025-02-26 14:25:58 +00:00
blyxyas
0ee39a2015 Several improvements on lintcheck perf (desc.)
- Now lintcheck perf deletes target directory after benchmarking,
benchmarking with a cache isn't very useful or telling of any
precise outcome.

- Support for benchmarking several times without having to do
a cargo clean. Now we can benchmark a PR and master (or a single
change in the same commit) without having to move the perf.data files
into an external directory.

- Compress perf.data to allow for allowing multiple stacks and
occupy much less space
2025-02-10 23:44:47 +01:00
blyxyas
48ae7ec894 Adress review comments 2025-01-31 16:12:28 +01:00
blyxyas
fc00cdcf28 Actually make --perf imply -j=1, review comments 2025-01-30 21:04:50 +01:00
blyxyas
d49b1ffdab Implement --perf flag to lintcheck for benchmarking
Turns out I was completely overcomplicating myself,
there was no need for an external tool such as becnhv2
or even the original becnh, we already had the benchmarking
infrastructure right under our noses!

This PR implements a new **lintcheck** option called
--perf, using it as a flag will mean that lintcheck
builds Clippy as a release package and hooks perf to it.

The realization that lintcheck is already 90% of what
a benchmarking tool needs came to me in a dream.
2025-01-30 19:45:23 +01:00
Samuel Tardieu
3a7f50f6d3 Apply unnecessary_semicolon to Clippy sources 2025-01-19 15:34:07 +01:00
Samuel Tardieu
a4805ff610 Select edition 2024 2025-01-13 16:55:42 +01:00
Samuel Moelius
8a38bcc390 Make "all fields are shorthand" requirement configurable
Handle field attributes in suggestions

Fix adjacent code

Address review comments

https://github.com/rust-lang/rust-clippy/pull/13737#discussion_r1861352124

Address all review comments but one

This comment is not yet addressed: https://github.com/rust-lang/rust-clippy/pull/13737#discussion_r1874544907

`initializer_suggestions` -> `lint_inconsistent_struct_field_initializers`
2024-12-26 19:36:58 -05:00
Guillaume Gomez
cfc6444f84 Limit literal_string_with_formatting_args to known variables if no formatting argument is passed 2024-11-22 14:58:59 +01:00
Guillaume Gomez
8d5a4e95e3 Allow literal_string_with_formatting_arg in some clippy crates 2024-11-22 14:57:20 +01:00
Samuel Tardieu
36c31db705 Apply updated needless_raw_strings to Clippy sources 2024-10-07 18:29:25 +02:00
Samuel Tardieu
9dd6820edd lintcheck: bump futures* crates to 0.3.31
Version 0.3.30 doesn't compile with our nightly version.
2024-10-05 19:04:45 +02:00
Yuri Astrakhan
f7d5d9d892 Convert &Option<T> to Option<&T> 2024-09-28 19:51:02 -04:00
Philipp Krones
3ab1da8bab
Formatting 2024-09-22 20:52:15 +02:00
Jason Newcomb
173d5a6af0 Merge commit '0f8eabd623' into clippyup 2024-08-24 18:33:44 -04:00
Philipp Krones
1ac76a2062 Merge commit 'cb806113e0' into clippy-subtree-update 2024-08-08 19:13:50 +02:00
Philipp Krones
4e6851e50b Merge commit '37f4fbb929' into clippy-subtree-update 2024-07-25 18:29:17 +02:00
Philipp Krones
c1fd25d0aa Merge commit 'b794b8e08c' into clippy-subtree-update 2024-07-11 15:44:03 +02:00
Philipp Krones
abdd057163 Merge commit '68a799aea9' into clippy-subtree-update 2024-06-27 18:56:04 +02:00
Philipp Krones
3bff119f63 Merge commit '3e5a02b13b' into clippy-subtree-update 2024-06-13 12:30:48 +02:00
Philipp Krones
4363278c73 Merge commit '2efebd2f0c' into clippy-subtree-update 2024-05-21 10:39:30 -07:00
Markus Reiter
d32629891a Use generic NonZero. 2024-05-08 21:37:55 +02:00
Philipp Krones
a5aaf33422 Merge commit 'ca3b393750' into clippy-subtree-update 2024-04-18 17:48:52 +02:00
Philipp Krones
0ae4a048c6 Merge commit '9725c4a162' into clippy-subtree-update 2024-04-04 19:52:55 +02:00
Philipp Krones
7be6e2178e Merge commit '10136170fe' into clippy-subtree-update 2024-02-27 15:50:17 +01:00