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
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
Samuel Tardieu
0e42ba908c
Permit specifying a non-default edition when linting file
...
`cargo dev lint /tmp/file.rs -- --edition 2021` will select edition
2021.
2025-02-07 00:21:49 +01:00
Samuel Tardieu
8a9d55012d
Use edition 2024 when running cargo dev lint
2025-02-06 18:59:33 +01:00
Philipp Krones
5aa9d7ae7f
Merge commit '3e3715c31236bff56f1c63a1de2c7bbdfcfb0923' into clippy-subtree-update
2025-02-06 15:00:24 +01:00
Philipp Krones
f549562b81
Merge remote-tracking branch 'upstream/master' into rustup
2025-02-06 14:31:01 +01:00
Catherine Flores
e02c8857e8
Move format_push_string and format_collect to pedantic ( #13894 )
...
Closes #11434 by moving `format_push_string` and `format_collect` to
pedantic.
changelog: Move `format_push_string` and `format_collect` to pedantic
2025-01-28 19:32:24 +00:00
Philipp Krones
9da9ddb7db
Merge commit '51d49c1ae2785b24ef18a46ef233fc1d91844666' into clippy-subtree-update
2025-01-28 19:33:54 +01:00
Kalle Wachsmuth
25a77cf4f4
remove clippy::double_neg
2025-01-26 12:15:12 +01:00
Samuel Tardieu
3a7f50f6d3
Apply unnecessary_semicolon to Clippy sources
2025-01-19 15:34:07 +01:00
Samuel Moelius
87f7e21009
Address review comments
2025-01-14 06:06:06 -05:00
Samuel Tardieu
a4805ff610
Select edition 2024
2025-01-13 16:55:42 +01:00
Philipp Krones
d0a74af979
Merge commit '19e305bb57a7595f2a8d81f521c0dd8bf854e739' into clippy-subtree-update
2025-01-09 18:57:00 +01:00
Samuel Moelius
a7adb8217e
Move format_push_string and format_collect to pedantic
2024-12-29 07:44:06 -05: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
Philipp Krones
d58b911e01
Merge commit 'ff4a26d442bead94a4c96fb1de967374bc4fbd8e' into clippy-subtree-update
2024-11-28 19:38:59 +01:00
Philipp Krones
93d5ccdba7
Add cargo dev release subcommand
...
Currently this only provides the feature to auto-update the versions in the
`Cargo.toml` files. With the move to Josh, a command to get beta and stable
release commits will be added.
2024-11-19 17:59:33 +01:00
Philipp Krones
66715532ab
Add cargo dev sync subcommand
...
Currently this only provides the feature to auto-update the nightly version in
the `rust-toolchain` file and the `clippy_utils/README.md` file. The actual sync
to and from the Rust repo will be added with the move to Josh.
2024-11-19 17:59:33 +01:00
Philipp Krones
9c8d9504ce
Introduce utils mod in clippy_dev
...
There was some dependence between the different subcommands of clippy_dev. And
this dependence will increased with the introduction of the sync and release
subcommands. This moves the common functions to a `utils` module, to decouple
the other modules.
2024-11-18 10:04:27 +01:00
Philipp Krones
5c1811ab94
Rename all clippy_config::msrvs -> clippy_utils::msrvs
2024-11-15 19:38:09 +01:00
Philipp Krones
1ceaa90413
Merge commit '786fbd6d683933cd0e567fdcd25d449a69b4320c' into clippy-subtree-update
2024-11-14 19:35:26 +01:00