Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 86e559b

Browse files
committed
Auto merge of rust-lang#16211 - tetsuharuohzeki:update-lint, r=Veykril
Use Cargo's [workspace.lints.*] to config clippy This change begin to use [`[workspace.lints.*]`](https://doc.rust-lang.org/cargo/reference/workspaces.html#the-lints-table) that is stabilized since [Rust 1.74](https://blog.rust-lang.org/2023/11/16/Rust-1.74.0.html). By this change, we make the configure more readable and simplify `xargo lint` more.
2 parents 1a0b772 + efc8709 commit 86e559b

File tree

44 files changed

+134
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+134
-2
lines changed

.cargo/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
xtask = "run --package xtask --bin xtask --"
33
tq = "test -- -q"
44
qt = "tq"
5-
lint = "clippy --all-targets -- -Aclippy::collapsible_if -Aclippy::needless_pass_by_value -Aclippy::nonminimal_bool -Aclippy::redundant_pattern_matching --cap-lints warn"
5+
lint = "clippy --all-targets -- --cap-lints warn"
66

77
[target.x86_64-pc-windows-msvc]
88
linker = "rust-lld"

Cargo.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ exclude = ["crates/proc-macro-srv/proc-macro-test/"]
44
resolver = "2"
55

66
[workspace.package]
7-
rust-version = "1.70"
7+
rust-version = "1.74"
88
edition = "2021"
99
license = "MIT OR Apache-2.0"
1010
authors = ["rust-analyzer team"]
@@ -133,3 +133,9 @@ xshell = "0.2.5"
133133

134134
# We need to freeze the version of the crate, as the raw-api feature is considered unstable
135135
dashmap = { version = "=5.5.3", features = ["raw-api"] }
136+
137+
[workspace.lints.clippy]
138+
collapsible_if = "allow"
139+
needless_pass_by_value = "allow"
140+
nonminimal_bool = "allow"
141+
redundant_pattern_matching = "allow"

crates/base-db/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ stdx.workspace = true
2525
syntax.workspace = true
2626
vfs.workspace = true
2727
span.workspace = true
28+
29+
[lints]
30+
workspace = true

crates/cfg/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,6 @@ derive_arbitrary = "1.3.2"
2929
# local deps
3030
mbe.workspace = true
3131
syntax.workspace = true
32+
33+
[lints]
34+
workspace = true

crates/flycheck/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,6 @@ command-group.workspace = true
2424
paths.workspace = true
2525
stdx.workspace = true
2626
toolchain.workspace = true
27+
28+
[lints]
29+
workspace = true

crates/hir-def/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,6 @@ test-fixture.workspace = true
5454

5555
[features]
5656
in-rust-tree = ["rustc-dependencies/in-rust-tree"]
57+
58+
[lints]
59+
workspace = true

crates/hir-expand/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ span.workspace = true
3636

3737
[dev-dependencies]
3838
expect-test = "1.4.0"
39+
40+
[lints]
41+
workspace = true

crates/hir-ty/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,6 @@ test-fixture.workspace = true
5858

5959
[features]
6060
in-rust-tree = ["rustc-dependencies/in-rust-tree"]
61+
62+
[lints]
63+
workspace = true

crates/hir/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,6 @@ tt.workspace = true
3333

3434
[features]
3535
in-rust-tree = []
36+
37+
[lints]
38+
workspace = true

crates/ide-assists/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ sourcegen.workspace = true
3636

3737
[features]
3838
in-rust-tree = []
39+
40+
[lints]
41+
workspace = true

0 commit comments

Comments
 (0)