Commit Graph

374 Commits

Author SHA1 Message Date
Philipp Krones 1e283ba0ce Merge remote-tracking branch 'upstream/master' into rustup 2026-03-21 13:40:20 +01:00
Philipp Krones b4d2445432 Merge commit 'e645f93552c3926a0bb481a777df120b7bce986f' 2026-03-05 17:18:20 +01:00
Philipp Krones eb386eca43 Merge remote-tracking branch 'upstream/master' into rustup 2026-03-05 16:59:08 +01:00
Jason Newcomb e16c838439 clippy_dev: Sort all lint and lint pass declarations. 2026-03-03 14:40:35 -05:00
Jason Newcomb 1f2be4e71b clippy_dev: Parse and format lint pass macros. 2026-03-03 14:40:35 -05:00
Jason Newcomb 9798fafcb7 clippy_dev: Rename update_lints module to generate 2026-03-03 14:40:35 -05:00
Philipp Krones 088022c7d4 Merge commit 'df995ede1b3e61f0e87081d9548e6cd2a3ec9095' into clippy-subtree-update 2026-02-24 12:00:51 +01:00
llogiq a57ca61784 clippy_dev: Parsing revamp part 4/N (#15978)
Based on rust-lang/rust-clippy#15947

Simple change in this one. Lints are parsed into a map indexed by name
in order to detect overlapping lint names. The panic message when a
duplicate name is parsed is unhelpful right now. That will be fixed in a
future PR along with improving all the other parsing errors.

changelog: none
2026-02-22 14:17:50 +00:00
linshuy2 5be3049e9c Apply collapsible_match to Clippy itself 2026-02-15 00:27:19 +00:00
Jason Newcomb 2658ce8205 clippy_dev: Use types to differentiate rustc and clippy lints. 2026-02-13 11:14:18 -05:00
Jason Newcomb 2655d8dd4b clippy_dev: Stores parsed lints in a map indexed by name. 2026-02-13 11:14:18 -05:00
Philipp Krones c8fd55b457 Merge commit 'a62c6af53676bb15a40488ce2d632de558f001de' into clippy-subtree-update 2026-02-12 14:50:58 +01:00
Yuri Astrakhan 236dac8d0e fix: remove unnecessary trailing commas in format strings
This PR makes the new comma-removing lint PR less noisy, allowing it focus only on the new functionality
2026-02-07 14:02:33 -05:00
Philipp Krones 977eddef3f Merge commit '54482290b5f32e6c6b57cc9e0a17153f432b0036' into clippy-subtree-update 2026-01-22 19:02:54 +01:00
Philipp Krones 94fe3ddd93 Merge remote-tracking branch 'upstream/master' into rustup 2026-01-22 16:55:00 +01:00
Jason Newcomb 5e8d1b541c clippy_dev: Re-enable deleting the module declaration on deprecation and uplifting. 2026-01-12 05:38:05 -05:00
Jason Newcomb 31db6aa5b2 clippy_dev: When renaming a lint better handle the case where the renamed lint is a prefix of another lint name. 2026-01-12 05:38:05 -05:00
Jason Newcomb 8d4e435f49 clippy_dev: Move rename_lint command to edit_lints module. 2026-01-12 05:38:05 -05:00
Jason Newcomb d9fa6d9515 clippy_dev: Rename deprecate_lint module to edit_lints. 2026-01-12 05:38:05 -05:00
Jason Newcomb 756e1bac6e clippy_dev: Move lint uplifting into its own command. 2026-01-12 05:38:05 -05:00
Samuel Tardieu 331a474142 Add new duration_suboptimal_units lint (#16250)
`Duration::from_mins` and `Duration::from_hours` where [recently
stabilized](https://github.com/rust-lang/rust/issues/140881) in Rust
1.91.0.

In our codebase we often times have things like

```rust
Duration::from_secs(5 * 60);
// Since Rust 1.91.0 one can use
Duration::from_mins(5)
```

During the Rust 1.91.0 bump I noticed we can finally switch to
`Duration::from_mins(5)`, but many users might not be aware of this. I
started manually updating the places, but halfway through I figured
"Can't a lint do this for me?", so I added exactly that in this PR. It
does it for all stabilized `from_XXX` time units.

changelog: Add new [`duration_suboptimal_units`] lint
Closes rust-lang/rust-clippy#16335
2026-01-09 16:08:40 +00:00
Sebastian Bernauer 0946c867a8 Add new duration_suboptimal_units lint 2026-01-09 16:40:04 +01:00
Guillaume Gomez 21f6afca40 Update literal-escaper version to 0.0.7 2026-01-08 14:10:33 +01:00
Philipp Krones 54e9e8cd38 Merge commit '99edcadfd5f6f6e8da34b1ba62774b53f5ca3863' into clippy-subtree-update 2025-12-25 23:24:43 +01:00
Philipp Krones 28d62f0833 Don't take rustc-literal-escaper from sysroot
This resulted in the following error for me:

    error[E0464]: multiple candidates for `rlib` dependency `rustc_literal_escaper` found
      --> clippy_dev/src/lib.rs:25:1
       |
    25 | extern crate rustc_literal_escaper;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = note: candidate #1: /home/pkrones/.rustup/toolchains/nightly-2025-12-25-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_literal_escaper-4f30574e01c3dad1.rlib
       = note: candidate #2: /home/pkrones/.rustup/toolchains/nightly-2025-12-25-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_literal_escaper-c8a0e29ad1040cee.rmeta

Other tools in the Rust repo also take that as an explicit dependency, like rust-analyzer or lint-docs.
2025-12-25 20:51:01 +01:00
Philipp Krones 44731205b8 Merge commit '62589a21d351f63d77dcd173c31107e9f1d06328' into clippy-subtree-update 2025-11-16 15:19:59 +01:00
Jason Newcomb 2027c0e02b Update dev new_lint to add passes to each array. 2025-11-14 07:50:55 -05:00
Philipp Krones c71f7b63f8 Merge commit 'c936595d17413c1f08e162e117e504fb4ed126e4' into clippy-subtree-update 2025-10-31 19:15:42 +01:00
Jason Newcomb bae625fed0 clippy_dev: Allocate onto an arena when parsing. 2025-10-22 19:09:23 -04:00
Jason Newcomb 7579e71c1f clippy_dev: Inline and simplify read_src_with_module. 2025-10-22 19:09:23 -04:00
Jason Newcomb fcfab5fe4b clippy_dev: Move all parsing within a parse context. 2025-10-22 19:09:23 -04:00
Philipp Krones 8f61305722 Merge commit 'd9fb15c4b1ebe9e7dc419e07f53af681d7860cbe' into clippy-subtree-update 2025-10-16 20:38:28 +02:00
Jason Newcomb 1b31b09c89 clippy_dev: Add specialized helpers for finding identifiers to the token cursor. 2025-10-11 17:58:26 -04:00
Jason Newcomb 422d459308 clippy_dev: Capture token patterns by position and length. 2025-10-11 17:53:19 -04:00
Jason Newcomb 5e36990de0 clippy_dev: Use the new ranges. 2025-10-11 17:53:19 -04:00
Jason Newcomb 88c0674bc8 clippy_dev: Rename RustSearcher to Cursor and move it to its own module. 2025-10-11 17:53:19 -04:00
Jason Newcomb 4f403f39b5 clippy_dev: Validate lint name format during argument parsing. 2025-10-11 11:30:33 -04:00
Jason Newcomb 813eb082f3 clippy_dev: Move parsing code to it's own module. 2025-10-10 23:57:05 -04:00
Nick Drozd 5318883d75 Use expect for lint warnings 2025-10-06 20:17:12 -04:00
Philipp Krones 71b79ab466 Merge commit '877967959ae8da9814df4f2614971f4d784bf53f' into clippy-subtree-update 2025-08-22 14:57:22 +02:00
Jason Newcomb fc42a205e9 Misc clippy_dev changes (#14896)
changelog: none
2025-08-17 11:26:46 +00:00
Philipp Krones 5c7418b38a Merge commit '1db89a1b1ca87f24bf22d0bad21d14b2d81b3e99' into clippy-subtree-update 2025-07-25 15:54:22 +02:00
Philipp Krones c98e60a56e Merge remote-tracking branch 'upstream/master' into rustup 2025-07-25 15:04:01 +02:00
Jason Newcomb 913681464e Make utils module private. 2025-07-11 01:05:40 -04:00
Jason Newcomb e624b77592 Inline cargo_clippy_path and add a note about removing it when possible 2025-07-11 01:05:40 -04:00
Jason Newcomb ed1088eec4 Use track_caller more for better error spans in clippy_dev 2025-07-11 00:59:19 -04:00
Jason Newcomb 46ff0a8565 Add helper function for creating cargo commands. 2025-07-11 00:59:19 -04:00
Jason Newcomb ed50c8a0e9 Make dev serve actually detect all updates 2025-07-11 00:57:50 -04:00
Jason Newcomb fc8bf97095 Rename exit_if_err to run_exit_on_err 2025-07-11 00:57:50 -04:00
Philipp Krones 4e614bf683 Merge commit 'cdbbf3afda0b1bf51568b368f629b1d828507f98' into clippy-subtree-update 2025-07-10 20:25:36 +02:00