Philipp Krones
c98e60a56e
Merge remote-tracking branch 'upstream/master' into rustup
2025-07-25 15:04:01 +02:00
Philipp Krones
4e614bf683
Merge commit 'cdbbf3afda0b1bf51568b368f629b1d828507f98' into clippy-subtree-update
2025-07-10 20:25:36 +02:00
Philipp Krones
9e0f749e08
Merge remote-tracking branch 'upstream/master' into rustup
2025-07-10 20:01:08 +02:00
Samuel Tardieu
fc3d5e6827
Remove unneeded .as_bytes()
...
`&str` already implements `AsRef<[u8]>`
2025-07-02 00:25:37 +02:00
Philipp Krones
074ccaf3c0
Merge commit 'c5dbd1de07e0407b9687619a868384d6de06253f' into clippy-subtree-update
2025-06-27 12:20:57 +02:00
Philipp Krones
90364dd178
Merge remote-tracking branch 'upstream/master' into rustup
2025-06-26 19:29:33 +02:00
Marijn Schouten
05b74d558f
update to literal-escaper 0.0.4 for better API without unreachable and faster string parsing
2025-06-23 06:36:22 +00:00
Samuel Tardieu
7c828e63ba
or_fun_call: lint more methods ( #15071 )
...
Extend `or_fun_call` lint with new checks for Option::get_or_insert,
Result::map_or.
changelog: [`or_fun_call`]: lint more methods
2025-06-21 09:21:42 +00:00
Jason Newcomb
acd8810e77
Prepare to split lints into multiple crates
...
* Move `declare_clippy_lint` to it's own crate
* Move lint/group registration into the driver
* Make `dev update_lints` handle multiple lint crates
2025-06-18 22:37:23 -04:00
klensy
9ed1843653
dogfood clippy::or_fun_call
2025-06-17 15:42:54 +03:00
Philipp Krones
cbd683fe31
Merge commit '4ef75291b5dd6739212f1f61666d19d4e086690d' into clippy-subtree-update
2025-06-13 11:24:45 +02:00
krikera
89dc07acb5
chore: fix smart quote in comment used by update_lints script
2025-06-01 19:20:33 +05:30
Philipp Krones
9f86a576e3
Merge commit '57cbadd68ac473bc50453f6b1320a02b68115f12'
2025-05-31 14:22:15 +02:00
Samuel Tardieu
3da4c1033a
Improve speed of cargo dev fmt ( #14862 )
...
This stops using `cargo fmt` and instead calls rustfmt directly with the
list of all files.
All `cargo fmt` does is find the crate roots and passes the edition from
`cargo.toml`. Since the edition is set in `rustfmt.toml` for the test
files and we're already iterating through all the files this is not
needed.
`--skip-children` is used since we already pass all the files, so the
automatic detection isn't buying us anything other than running slower.
~Second commit~ (part of the first commit now) is a change to only use
the `ignore` option in `rustfmt.toml` rather than having a way in `cargo
dev fmt` to ignore files.
r? @samueltardieu
changelog: none
2025-05-21 20:31:46 +00:00
Jason Newcomb
106ac79ecb
Add expect_action helper to clippy_dev
2025-05-21 15:09:35 -04:00
Jason Newcomb
544c300fb6
Improve speed of cargo dev fmt.
2025-05-21 15:09:35 -04:00
Philipp Krones
7debaf6b44
Merge commit 'cadf98bb7d783e2ea3572446c3f80d3592ec5f86' into clippy-subtree-update
2025-05-21 15:15:38 +02:00
Philipp Krones
8a28b797b8
Bump nightly version -> 2025-05-21
2025-05-21 14:50:25 +02:00
Samuel Tardieu
82bf659dc8
Ensure that symbols list stays sorted
2025-05-19 22:47:57 +02:00
Samuel Tardieu
608f6822ca
cargo dev fmt: format clippy_lints_internal as well
2025-05-19 18:10:59 +02:00
Jason Newcomb
232be55859
clippy_dev: refactor rustfmt calls
2025-05-17 06:11:19 -04:00
Jason Newcomb
9d47e0c8ce
clippy_dev: remove the need for markers when bumping the version
2025-05-17 04:27:39 -04:00
Jason Newcomb
13b070e356
clippy_dev: Fix previous renames in rename_lint
2025-05-16 06:43:55 -04:00
Jason Newcomb
b3f490202b
clippy_dev: order deprecated_lints.rs in update_lints
2025-05-16 06:43:52 -04:00
Jason Newcomb
44681fd81b
Improve cargo dev rename_lint
...
* rename test files inside directories and ui-toml tests
* rename tests prefixed with the lint's name
* better module path renaming when renaming the lint's module
* partially delete lint files when uplifting
* rename ui_test error markers
2025-05-16 06:20:13 -04:00
Philipp Krones
93bd4d8931
Merge commit '0450db33a5d8587f7c1d4b6d233dac963605766b' into clippy-subtree-update
2025-05-15 19:28:39 +02:00
Philipp Krones
0bb1b5bd3b
Merge remote-tracking branch 'upstream/master' into rustup
2025-05-15 19:19:08 +02:00
Jason Newcomb
0636121964
clippy_dev: Remove print option from update_lints
2025-05-12 17:07:53 -04:00
Jason Newcomb
a9beb8b68d
clippy_dev: Refactor token parsing to avoid macros.
2025-05-12 17:07:53 -04:00
Jason Newcomb
97abf33fa0
clippy_dev: Split gathering lint decls from parsing deprecated lints.
2025-05-12 17:07:53 -04:00
Jason Newcomb
2c85cb0371
clippy_dev: Only build AhoCorasick searcher once for multiple files.
2025-05-12 17:07:52 -04:00
Jason Newcomb
98cb92f323
clippy_dev: Reuse buffers when updating files and don't write unchanged files in clippy_dev
2025-05-12 17:07:52 -04:00
Jason Newcomb
3fe5fb2967
clippy_dev: Split rename and deprecate out of update_lints
2025-05-12 17:07:52 -04:00
Jason Newcomb
2f39264d00
clippy_dev: Set the current directory to clippy's root path.
2025-05-12 17:07:52 -04:00
Alex Macleod
737d3b3363
Remove some unused #![feature]s
2025-05-06 14:07:39 +00:00
Jason Newcomb
fb9508d7a0
Fix new_lint clippy command ( #14642 )
...
I'm working on https://github.com/rust-lang/rust-clippy/issues/14542 and
I decided to name the lint `unnecessary_map` originally. However when I
ran the command, I got:
```
thread 'main' panicked at clippy_dev/src/new_lint.rs:450:5:
Lint `unnecessary_map` already defined in `/home/imperio/rust/clippy/clippy_lints/src/methods/mod.rs`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
It's because there is already a `unnecessary_map_or`, which matches the
`.contains()` call. This PR strengthens this check.
changelog: Fix `new_lint` clippy command
r? @flip1995
2025-05-02 15:47:40 +00:00
Philipp Krones
ff428d91c2
Merge commit '0621446356e20fd2ead13a6763bb936c95eb0cfa' into clippy-subtree-update
2025-04-22 18:24:43 +02:00
Timo
781fdab9a9
Move internal lints to their own crate ( #13223 )
...
This makes it so switching the internal feature on/off no longer
rebuilds `clippy_lints`.
r? @flip1995
changelog: none
2025-04-18 12:04:08 +00:00
Philipp Krones
de90fa42dd
Merge remote-tracking branch 'upstream/master' into rustup
2025-04-17 18:36:59 +02:00
Guillaume Gomez
7bfb15cd11
Fix new_lint clippy command
2025-04-17 16:31:56 +02:00
Jason Newcomb
5b4b463d49
Move internal lints to their own crate
2025-04-12 17:53:36 -04: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
lapla-cogito
19c7c46d48
rename rust-toolchain to rust-toolchain.toml
2025-03-21 09:37:59 +09:00
Philipp Krones
fe01c44995
Merge commit '9f9a822509e5ad3e560cbbe830d1013f936fca28' into clippy-subtree-update
2025-02-28 23:27:09 +01:00
Alex Macleod
0972c3b565
Check for MSRV attributes in late passes using the HIR
2025-02-28 18:09:44 +00:00
Andre Bogus
6366cca439
add io_other_error lint
2025-02-21 22:08:31 +01:00
Philipp Krones
735bed7aa5
Add cargo dev setup toolchain --standalone ( #14230 )
...
Allows creating a toolchain that's independent of the local build, for
example to make two separate toolchains with slight differences without
requiring two checkouts of clippy
changelog: none
2025-02-17 10:18:16 +00:00
Alex Macleod
058ae80a55
Add cargo dev setup toolchain --standalone
2025-02-16 14:43:18 +00:00
Samuel Tardieu
6dd477ad5a
Add --allow-no-vcs to cargo dev dogfood --fix
...
Some developers might prefer to use alternate VCS, such as Jujutsu, which
are not detected by `cargo fix`. This forwards the `--allow-no-vcs`
command line argument to `cargo fix`.
2025-02-16 13:06:03 +01:00
Michael Howell
ac15a10b55
just_underscores_and_digits: ignore empty ident
...
Empty idents come from error recovery, and should imply that a
better error has already been emitted.
2025-02-11 09:35:43 -07:00