Skip to content

Commit b546bc5

Browse files
Jonathan Woollett-Lightroypat
Jonathan Woollett-Light
authored andcommitted
build: Lints in .toml files
Moves lint configuration from `.cargo/config` to `Cargo.toml`. Signed-off-by: Jonathan Woollett-Light <[email protected]>
1 parent 5e8c0a8 commit b546bc5

File tree

13 files changed

+47
-10
lines changed

13 files changed

+47
-10
lines changed

.cargo/config

-10
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,6 @@
22
target-dir = "build/cargo_target"
33
rustflags = [
44
"-Ccodegen-units=1",
5-
"-Wclippy::ptr_as_ptr",
6-
"-Wclippy::undocumented_unsafe_blocks",
7-
"-Wclippy::cast_lossless",
8-
"-Wclippy::cast_possible_truncation",
9-
"-Wclippy::cast_possible_wrap",
10-
"-Wclippy::cast_sign_loss",
11-
"-Wmissing_debug_implementations",
12-
"-Wclippy::exit",
13-
"-Wclippy::tests_outside_test_module",
14-
"-Wclippy::assertions_on_result_states"
155
]
166

177
[net]

Cargo.toml

+14
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@ members = ["src/clippy-tracing", "src/cpu-template-helper", "src/firecracker", "
33
default-members = ["src/clippy-tracing", "src/cpu-template-helper", "src/firecracker", "src/rebase-snap", "src/seccompiler", "src/snapshot-editor"]
44
resolver = "2"
55

6+
[workspace.lints.rust]
7+
missing_debug_implementations = "warn"
8+
9+
[workspace.lints.clippy]
10+
ptr_as_ptr = "warn"
11+
undocumented_unsafe_blocks = "warn"
12+
cast_lossless = "warn"
13+
cast_possible_truncation = "warn"
14+
cast_possible_wrap = "warn"
15+
cast_sign_loss = "warn"
16+
exit = "warn"
17+
tests_outside_test_module = "warn"
18+
assertions_on_result_states = "warn"
19+
620
[profile.dev]
721
panic = "abort"
822

src/clippy-tracing/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ walkdir = "2.3.3"
1919

2020
[dev-dependencies]
2121
uuid = { version = "1.6.1", features = ["v4"] }
22+
23+
[lints]
24+
workspace = true

src/cpu-template-helper/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,6 @@ utils = { path = "../utils" }
2626

2727
[features]
2828
tracing = ["log-instrument", "vmm/tracing"]
29+
30+
[lints]
31+
workspace = true

src/firecracker/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ serde_json = "1.0.113"
4949
[features]
5050
tracing = ["log-instrument", "seccompiler/tracing", "utils/tracing", "vmm/tracing"]
5151

52+
[lints]
53+
workspace = true
54+
5255
[[example]]
5356
name = "uffd_malicious_handler"
5457
path = "examples/uffd/malicious_handler.rs"

src/jailer/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ utils = { path = "../utils" }
2222

2323
[features]
2424
tracing = ["log-instrument", "utils/tracing"]
25+
26+
[lints]
27+
workspace = true

src/log-instrument-macros/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ bench = false
1414
proc-macro2 = "1.0.73"
1515
quote = "1.0.34"
1616
syn = { version = "2.0.49", features = ["full", "extra-traits"] }
17+
18+
[lints]
19+
workspace = true

src/log-instrument/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,6 @@ log-instrument-macros = { path = "../log-instrument-macros" }
3333

3434
[dev-dependencies]
3535
env_logger = "0.11.2"
36+
37+
[lints]
38+
workspace = true

src/rebase-snap/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ utils = { path = "../utils" }
1919

2020
[features]
2121
tracing = ["log-instrument", "utils/tracing"]
22+
23+
[lints]
24+
workspace = true

src/seccompiler/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ utils = { path = "../utils" }
2828

2929
[features]
3030
tracing = ["log-instrument", "utils/tracing"]
31+
32+
[lints]
33+
workspace = true

src/snapshot-editor/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ clap-num = "1.0.2"
2525

2626
[features]
2727
tracing = ["log-instrument", "fc_utils/tracing", "vmm/tracing"]
28+
29+
[lints]
30+
workspace = true

src/utils/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@ serde_json = "1.0.99"
2323

2424
[features]
2525
tracing = ["log-instrument"]
26+
27+
[lints]
28+
workspace = true

src/vmm/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,6 @@ tracing = ["log-instrument"]
5858
[[bench]]
5959
name = "cpu_templates"
6060
harness = false
61+
62+
[lints]
63+
workspace = true

0 commit comments

Comments
 (0)