Browse Source

introduce workspace lints, warn on unused crates

In practice this will forbid unused dependencies because we run clippy
with `--deny warnings`.

Workspace lints is a nice place to ratchet up lints through the codebase
all at once and consistently.
Tamir Duberstein 1 month ago
parent
commit
a43e40ae1d

+ 3 - 0
Cargo.toml

@@ -103,6 +103,9 @@ tokio = { version = "1.24.0", default-features = false }
 which = { version = "7.0.0", default-features = false }
 xdpilone = { version = "1.0.5", default-features = false }
 
+[workspace.lints.rust]
+unused-extern-crates = "warn"
+
 [profile.release.package.integration-ebpf]
 debug = 2
 codegen-units = 1

+ 3 - 0
aya-build/Cargo.toml

@@ -9,6 +9,9 @@ homepage.workspace = true
 rust-version.workspace = true
 edition.workspace = true
 
+[lints]
+workspace = true
+
 [dependencies]
 anyhow = { workspace = true, default-features = true }
 cargo_metadata = { workspace = true }

+ 3 - 0
aya-ebpf-macros/Cargo.toml

@@ -9,6 +9,9 @@ homepage.workspace = true
 rust-version.workspace = true
 edition.workspace = true
 
+[lints]
+workspace = true
+
 [lib]
 proc-macro = true
 

+ 3 - 0
aya-log-common/Cargo.toml

@@ -11,6 +11,9 @@ homepage.workspace = true
 rust-version.workspace = true
 edition.workspace = true
 
+[lints]
+workspace = true
+
 [dependencies]
 num_enum = { workspace = true }
 

+ 3 - 0
aya-log-ebpf-macros/Cargo.toml

@@ -9,6 +9,9 @@ homepage.workspace = true
 rust-version.workspace = true
 edition.workspace = true
 
+[lints]
+workspace = true
+
 [dependencies]
 aya-log-common = { path = "../aya-log-common", version = "^0.1.14", default-features = false }
 aya-log-parser = { path = "../aya-log-parser", version = "^0.1.13", default-features = false }

+ 3 - 0
aya-log-parser/Cargo.toml

@@ -9,6 +9,9 @@ homepage.workspace = true
 rust-version.workspace = true
 edition.workspace = true
 
+[lints]
+workspace = true
+
 [dependencies]
 aya-log-common = { path = "../aya-log-common", version = "^0.1.14", default-features = false }
 

+ 3 - 0
aya-log/Cargo.toml

@@ -12,6 +12,9 @@ homepage.workspace = true
 rust-version.workspace = true
 edition.workspace = true
 
+[lints]
+workspace = true
+
 [dependencies]
 aya = { path = "../aya", version = "^0.13.1", features = ["async_tokio"] }
 aya-log-common = { path = "../aya-log-common", version = "^0.1.15", default-features = false }

+ 3 - 0
aya-obj/Cargo.toml

@@ -12,6 +12,9 @@ homepage.workspace = true
 rust-version.workspace = true
 edition.workspace = true
 
+[lints]
+workspace = true
+
 [dependencies]
 bytes = { workspace = true }
 hashbrown = { workspace = true, default-features = true }

+ 3 - 0
aya-tool/Cargo.toml

@@ -10,6 +10,9 @@ homepage.workspace = true
 rust-version.workspace = true
 edition.workspace = true
 
+[lints]
+workspace = true
+
 [dependencies]
 bindgen = { workspace = true, default-features = true }
 clap = { workspace = true, default-features = true, features = ["derive"] }

+ 3 - 0
aya/Cargo.toml

@@ -12,6 +12,9 @@ homepage.workspace = true
 rust-version.workspace = true
 edition.workspace = true
 
+[lints]
+workspace = true
+
 [dependencies]
 assert_matches = { workspace = true }
 async-io = { workspace = true, optional = true }

+ 3 - 0
ebpf/aya-ebpf-bindings/Cargo.toml

@@ -8,5 +8,8 @@ repository.workspace = true
 homepage.workspace = true
 edition.workspace = true
 
+[lints]
+workspace = true
+
 [dependencies]
 aya-ebpf-cty = { version = "^0.2.2", path = "../aya-ebpf-cty" }

+ 3 - 0
ebpf/aya-ebpf-cty/Cargo.toml

@@ -10,3 +10,6 @@ repository.workspace = true
 homepage.workspace = true
 rust-version.workspace = true
 edition.workspace = true
+
+[lints]
+workspace = true

+ 3 - 0
ebpf/aya-ebpf/Cargo.toml

@@ -9,6 +9,9 @@ homepage.workspace = true
 rust-version.workspace = true
 edition.workspace = true
 
+[lints]
+workspace = true
+
 [dependencies]
 aya-ebpf-cty = { version = "^0.2.2", path = "../aya-ebpf-cty" }
 aya-ebpf-macros = { version = "^0.1.1", path = "../../aya-ebpf-macros" }

+ 3 - 0
ebpf/aya-log-ebpf/Cargo.toml

@@ -9,6 +9,9 @@ homepage.workspace = true
 rust-version.workspace = true
 edition.workspace = true
 
+[lints]
+workspace = true
+
 [dependencies]
 aya-ebpf = { version = "^0.1.1", path = "../aya-ebpf" }
 aya-log-common = { version = "^0.1.15", path = "../../aya-log-common" }

+ 3 - 0
init/Cargo.toml

@@ -9,6 +9,9 @@ homepage.workspace = true
 rust-version.workspace = true
 edition.workspace = true
 
+[lints]
+workspace = true
+
 [dependencies]
 anyhow = { workspace = true, features = ["std"] }
 nix = { workspace = true, features = ["fs", "mount", "reboot"] }

+ 3 - 0
test/integration-common/Cargo.toml

@@ -9,6 +9,9 @@ homepage.workspace = true
 rust-version.workspace = true
 edition.workspace = true
 
+[lints]
+workspace = true
+
 [dependencies]
 aya = { path = "../../aya", optional = true }
 

+ 3 - 0
test/integration-ebpf/Cargo.toml

@@ -9,6 +9,9 @@ homepage.workspace = true
 rust-version.workspace = true
 edition.workspace = true
 
+[lints]
+workspace = true
+
 [dependencies]
 aya-ebpf = { path = "../../ebpf/aya-ebpf" }
 aya-log-ebpf = { path = "../../ebpf/aya-log-ebpf" }

+ 3 - 0
test/integration-test/Cargo.toml

@@ -9,6 +9,9 @@ homepage.workspace = true
 rust-version.workspace = true
 edition.workspace = true
 
+[lints]
+workspace = true
+
 [dependencies]
 anyhow = { workspace = true, features = ["std"] }
 assert_matches = { workspace = true }

+ 3 - 0
xtask/Cargo.toml

@@ -9,6 +9,9 @@ homepage.workspace = true
 rust-version.workspace = true
 edition.workspace = true
 
+[lints]
+workspace = true
+
 [dependencies]
 anyhow = { workspace = true, features = ["std"] }
 aya-tool = { path = "../aya-tool", version = "0.1.0", default-features = false }