krikera
89dc07acb5
chore: fix smart quote in comment used by update_lints script
2025-06-01 19:20:33 +05:30
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
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
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 ' 0621446356' 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 ' 9f9a822509' 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 ' 3e3715c312' 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 ' 51d49c1ae2' 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 ' 19e305bb57' 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 ' ff4a26d442' into clippy-subtree-update
2024-11-28 19:38:59 +01:00