Use Cargo's [workspace.lints.*] to config clippy

This commit is contained in:
Tetsuharu Ohzeki 2023-12-29 23:22:29 +09:00
parent 25444cdd04
commit efc87092b3
44 changed files with 133 additions and 1 deletions

View file

@ -2,7 +2,7 @@
xtask = "run --package xtask --bin xtask --" xtask = "run --package xtask --bin xtask --"
tq = "test -- -q" tq = "test -- -q"
qt = "tq" qt = "tq"
lint = "clippy --all-targets -- -Aclippy::collapsible_if -Aclippy::needless_pass_by_value -Aclippy::nonminimal_bool -Aclippy::redundant_pattern_matching --cap-lints warn" lint = "clippy --all-targets -- --cap-lints warn"
[target.x86_64-pc-windows-msvc] [target.x86_64-pc-windows-msvc]
linker = "rust-lld" linker = "rust-lld"

View file

@ -133,3 +133,9 @@ xshell = "0.2.5"
# We need to freeze the version of the crate, as the raw-api feature is considered unstable # We need to freeze the version of the crate, as the raw-api feature is considered unstable
dashmap = { version = "=5.5.3", features = ["raw-api"] } dashmap = { version = "=5.5.3", features = ["raw-api"] }
[workspace.lints.clippy]
collapsible_if = "allow"
needless_pass_by_value = "allow"
nonminimal_bool = "allow"
redundant_pattern_matching = "allow"

View file

@ -25,3 +25,6 @@ stdx.workspace = true
syntax.workspace = true syntax.workspace = true
vfs.workspace = true vfs.workspace = true
span.workspace = true span.workspace = true
[lints]
workspace = true

View file

@ -29,3 +29,6 @@ derive_arbitrary = "1.3.2"
# local deps # local deps
mbe.workspace = true mbe.workspace = true
syntax.workspace = true syntax.workspace = true
[lints]
workspace = true

View file

@ -24,3 +24,6 @@ command-group.workspace = true
paths.workspace = true paths.workspace = true
stdx.workspace = true stdx.workspace = true
toolchain.workspace = true toolchain.workspace = true
[lints]
workspace = true

View file

@ -54,3 +54,6 @@ test-fixture.workspace = true
[features] [features]
in-rust-tree = ["rustc-dependencies/in-rust-tree"] in-rust-tree = ["rustc-dependencies/in-rust-tree"]
[lints]
workspace = true

View file

@ -36,3 +36,6 @@ span.workspace = true
[dev-dependencies] [dev-dependencies]
expect-test = "1.4.0" expect-test = "1.4.0"
[lints]
workspace = true

View file

@ -58,3 +58,6 @@ test-fixture.workspace = true
[features] [features]
in-rust-tree = ["rustc-dependencies/in-rust-tree"] in-rust-tree = ["rustc-dependencies/in-rust-tree"]
[lints]
workspace = true

View file

@ -33,3 +33,6 @@ tt.workspace = true
[features] [features]
in-rust-tree = [] in-rust-tree = []
[lints]
workspace = true

View file

@ -36,3 +36,6 @@ sourcegen.workspace = true
[features] [features]
in-rust-tree = [] in-rust-tree = []
[lints]
workspace = true

View file

@ -36,3 +36,6 @@ expect-test = "1.4.0"
# local deps # local deps
test-utils.workspace = true test-utils.workspace = true
test-fixture.workspace = true test-fixture.workspace = true
[lints]
workspace = true

View file

@ -50,3 +50,6 @@ xshell.workspace = true
test-utils.workspace = true test-utils.workspace = true
test-fixture.workspace = true test-fixture.workspace = true
sourcegen.workspace = true sourcegen.workspace = true
[lints]
workspace = true

View file

@ -37,3 +37,6 @@ sourcegen.workspace = true
[features] [features]
in-rust-tree = [] in-rust-tree = []
[lints]
workspace = true

View file

@ -32,3 +32,6 @@ expect-test = "1.4.0"
# local deps # local deps
test-utils.workspace = true test-utils.workspace = true
test-fixture.workspace = true test-fixture.workspace = true
[lints]
workspace = true

View file

@ -54,3 +54,6 @@ test-fixture.workspace = true
[features] [features]
in-rust-tree = ["ide-assists/in-rust-tree", "ide-diagnostics/in-rust-tree"] in-rust-tree = ["ide-assists/in-rust-tree", "ide-diagnostics/in-rust-tree"]
[lints]
workspace = true

View file

@ -18,3 +18,6 @@ dashmap.workspace = true
hashbrown.workspace = true hashbrown.workspace = true
rustc-hash.workspace = true rustc-hash.workspace = true
triomphe.workspace = true triomphe.workspace = true
[lints]
workspace = true

View file

@ -11,3 +11,6 @@ rust-version.workspace = true
[features] [features]
tracking = [] tracking = []
default = ["tracking"] default = ["tracking"]
[lints]
workspace = true

View file

@ -26,3 +26,6 @@ vfs-notify.workspace = true
span.workspace = true span.workspace = true
hir-expand.workspace = true hir-expand.workspace = true
[lints]
workspace = true

View file

@ -26,3 +26,6 @@ span.workspace = true
[dev-dependencies] [dev-dependencies]
test-utils.workspace = true test-utils.workspace = true
[lints]
workspace = true

View file

@ -25,3 +25,6 @@ sourcegen.workspace = true
[features] [features]
in-rust-tree = ["rustc-dependencies/in-rust-tree"] in-rust-tree = ["rustc-dependencies/in-rust-tree"]
[lints]
workspace = true

View file

@ -16,3 +16,6 @@ doctest = false
# serde-derive crate. Even though we don't activate the derive feature here, # serde-derive crate. Even though we don't activate the derive feature here,
# someone else in the crate graph certainly does! # someone else in the crate graph certainly does!
# serde.workspace = true # serde.workspace = true
[lints]
workspace = true

View file

@ -38,3 +38,6 @@ span.workspace = true
# InternIds for the syntax context # InternIds for the syntax context
base-db.workspace = true base-db.workspace = true
la-arena.workspace = true la-arena.workspace = true
[lints]
workspace = true

View file

@ -18,3 +18,6 @@ sysroot-abi = ["proc-macro-srv/sysroot-abi"]
[[bin]] [[bin]]
name = "rust-analyzer-proc-macro-srv" name = "rust-analyzer-proc-macro-srv"
path = "src/main.rs" path = "src/main.rs"
[lints]
workspace = true

View file

@ -38,3 +38,6 @@ proc-macro-test.path = "./proc-macro-test"
[features] [features]
sysroot-abi = ["proc-macro-test/sysroot-abi"] sysroot-abi = ["proc-macro-test/sysroot-abi"]
[lints]
workspace = true

View file

@ -31,3 +31,6 @@ jemalloc = ["jemalloc-ctl"]
# Uncomment to enable for the whole crate graph # Uncomment to enable for the whole crate graph
# default = [ "cpu_profiler" ] # default = [ "cpu_profiler" ]
[lints]
workspace = true

View file

@ -33,3 +33,6 @@ toolchain.workspace = true
[dev-dependencies] [dev-dependencies]
expect-test = "1.4.0" expect-test = "1.4.0"
[lints]
workspace = true

View file

@ -94,3 +94,6 @@ in-rust-tree = [
"hir-def/in-rust-tree", "hir-def/in-rust-tree",
"hir-ty/in-rust-tree", "hir-ty/in-rust-tree",
] ]
[lints]
workspace = true

View file

@ -18,3 +18,6 @@ ra-ap-rustc_abi = { version = "0.21.0", default-features = false }
[features] [features]
in-rust-tree = [] in-rust-tree = []
[lints]
workspace = true

View file

@ -14,3 +14,6 @@ doctest = false
[dependencies] [dependencies]
xshell.workspace = true xshell.workspace = true
[lints]
workspace = true

View file

@ -16,3 +16,6 @@ rust-analyzer-salsa.workspace = true
vfs.workspace = true vfs.workspace = true
syntax.workspace = true syntax.workspace = true
stdx.workspace = true stdx.workspace = true
[lints]
workspace = true

View file

@ -27,3 +27,6 @@ winapi = { version = "0.3.9", features = ["winerror"] }
[features] [features]
# Uncomment to enable for the whole crate graph # Uncomment to enable for the whole crate graph
# default = [ "backtrace" ] # default = [ "backtrace" ]
[lints]
workspace = true

View file

@ -42,3 +42,6 @@ sourcegen.workspace = true
[features] [features]
in-rust-tree = ["rustc-dependencies/in-rust-tree"] in-rust-tree = ["rustc-dependencies/in-rust-tree"]
[lints]
workspace = true

View file

@ -24,3 +24,6 @@ path = "fuzz_targets/parser.rs"
[[bin]] [[bin]]
name = "reparse" name = "reparse"
path = "fuzz_targets/reparse.rs" path = "fuzz_targets/reparse.rs"
[lints]
workspace = true

View file

@ -16,3 +16,6 @@ base-db.workspace = true
rustc-hash.workspace = true rustc-hash.workspace = true
span.workspace = true span.workspace = true
stdx.workspace = true stdx.workspace = true
[lints]
workspace = true

View file

@ -19,3 +19,6 @@ rustc-hash.workspace = true
stdx.workspace = true stdx.workspace = true
profile.workspace = true profile.workspace = true
[lints]
workspace = true

View file

@ -14,3 +14,6 @@ doctest = false
[dependencies] [dependencies]
itertools.workspace = true itertools.workspace = true
text-size.workspace = true text-size.workspace = true
[lints]
workspace = true

View file

@ -13,3 +13,6 @@ doctest = false
[dependencies] [dependencies]
home = "0.5.4" home = "0.5.4"
[lints]
workspace = true

View file

@ -19,3 +19,6 @@ stdx.workspace = true
# FIXME: Remove this dependency once the `Span` trait is gone (that is once Span::DUMMY has been removed) # FIXME: Remove this dependency once the `Span` trait is gone (that is once Span::DUMMY has been removed)
span.workspace = true span.workspace = true
[lints]
workspace = true

View file

@ -20,3 +20,6 @@ notify = "6.1.1"
stdx.workspace = true stdx.workspace = true
vfs.workspace = true vfs.workspace = true
paths.workspace = true paths.workspace = true
[lints]
workspace = true

View file

@ -19,3 +19,6 @@ nohash-hasher.workspace = true
paths.workspace = true paths.workspace = true
stdx.workspace = true stdx.workspace = true
[lints]
workspace = true

View file

@ -8,3 +8,6 @@ documentation = "https://docs.rs/la-arena"
categories = ["data-structures", "memory-management", "rust-patterns"] categories = ["data-structures", "memory-management", "rust-patterns"]
edition = "2021" edition = "2021"
rust-version = "1.56" rust-version = "1.56"
[lints]
workspace = true

View file

@ -9,3 +9,6 @@ edition = "2021"
[dependencies] [dependencies]
text-size = "1.1.1" text-size = "1.1.1"
nohash-hasher = "0.2.0" nohash-hasher = "0.2.0"
[lints]
workspace = true

View file

@ -15,3 +15,6 @@ crossbeam-channel = "0.5.6"
[dev-dependencies] [dev-dependencies]
lsp-types = "=0.95" lsp-types = "=0.95"
ctrlc = "3.4.1" ctrlc = "3.4.1"
[lints]
workspace = true

View file

@ -15,3 +15,6 @@ xflags = "0.3.0"
time = { version = "0.3", default-features = false } time = { version = "0.3", default-features = false }
zip = { version = "0.6", default-features = false, features = ["deflate", "time"] } zip = { version = "0.6", default-features = false, features = ["deflate", "time"] }
# Avoid adding more dependencies to this crate # Avoid adding more dependencies to this crate
[lints]
workspace = true