Skip to content

Commit 00b4f0c

Browse files
authored
Merge pull request #2341 from hermit-os/workspace-clippy
fix(xtask): Clippy
2 parents 5f693b5 + 0c3868b commit 00b4f0c

5 files changed

Lines changed: 41 additions & 34 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
- uses: mkroening/rust-toolchain-toml@main
4141
- run: rustup target add x86_64-unknown-none aarch64-unknown-none-softfloat riscv64gc-unknown-none-elf
4242
- run: rustup component add clippy
43+
- run: cargo clippy --package xtask
4344
- name: cargo hack clippy (x86_64)
4445
run: |
4546
cargo clippy --package hermit-kernel --target x86_64-unknown-none --features tcp,virtio-console,virtio-fs,virtio-net,virtio-vsock

Cargo.toml

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -278,34 +278,8 @@ trace = ["net-trace"]
278278
## An alias for the `virtio-vsock` feature.
279279
vsock = ["virtio-vsock"]
280280

281-
[lints.rust]
282-
rust_2018_idioms = "warn"
283-
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(careful)'] }
284-
unsafe_op_in_unsafe_fn = "warn"
285-
286-
[lints.clippy]
287-
borrow_as_ptr = "warn"
288-
cast_lossless = "warn"
289-
decimal_literal_representation = "warn"
290-
default_trait_access = "warn"
291-
explicit_deref_methods = "warn"
292-
if_not_else = "warn"
293-
ignored_unit_patterns = "warn"
294-
implicit_clone = "warn"
295-
inconsistent_struct_constructor = "warn"
296-
manual_assert = "warn"
297-
manual_let_else = "warn"
298-
match_same_arms = "warn"
299-
match_wildcard_for_single_variants = "warn"
300-
ptr_as_ptr = "warn"
301-
ptr_cast_constness = "warn"
302-
ref_as_ptr = "warn"
303-
ref_option = "warn"
304-
semicolon_if_nothing_returned = "warn"
305-
separated_literal_suffix = "warn"
306-
transmute_ptr_to_ptr = "warn"
307-
uninlined_format_args = "warn"
308-
unreadable_literal = "warn"
281+
[lints]
282+
workspace = true
309283

310284
[dependencies]
311285
hermit-macro = { version = "=0.1.0", path = "hermit-macro" }
@@ -410,6 +384,35 @@ exclude = [
410384
"hermit-builtins",
411385
]
412386

387+
[workspace.lints.rust]
388+
rust_2018_idioms = "warn"
389+
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(careful)'] }
390+
unsafe_op_in_unsafe_fn = "warn"
391+
392+
[workspace.lints.clippy]
393+
borrow_as_ptr = "warn"
394+
cast_lossless = "warn"
395+
decimal_literal_representation = "warn"
396+
default_trait_access = "warn"
397+
explicit_deref_methods = "warn"
398+
if_not_else = "warn"
399+
ignored_unit_patterns = "warn"
400+
implicit_clone = "warn"
401+
inconsistent_struct_constructor = "warn"
402+
manual_assert = "warn"
403+
manual_let_else = "warn"
404+
match_same_arms = "warn"
405+
match_wildcard_for_single_variants = "warn"
406+
ptr_as_ptr = "warn"
407+
ptr_cast_constness = "warn"
408+
ref_as_ptr = "warn"
409+
ref_option = "warn"
410+
semicolon_if_nothing_returned = "warn"
411+
separated_literal_suffix = "warn"
412+
transmute_ptr_to_ptr = "warn"
413+
uninlined_format_args = "warn"
414+
unreadable_literal = "warn"
415+
413416
[patch.crates-io]
414417
safe-mmio = { git = "https://github.com/hermit-os/safe-mmio", branch = "be" }
415418

xtask/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ ureq = { version = "3", default-features = false, features = ["rustls"], optiona
1919
vsock = { version = "0.5", optional = true }
2020
wait-timeout = { version = "0.2", optional = true }
2121
xshell = "0.2"
22+
23+
[lints]
24+
workspace = true

xtask/src/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ impl Build {
112112
}
113113

114114
if self.randomize_layout {
115-
rustflags.push("-Zrandomize-layout")
115+
rustflags.push("-Zrandomize-layout");
116116
}
117117

118118
rustflags.extend(self.cargo_build.artifact.arch.rustflags());

xtask/src/ci/qemu.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ impl Qemu {
159159

160160
match image_name {
161161
"axum-example" | "http_server" | "http_server_poll" | "http_server_select" => {
162-
test_http_server(guest_ip)?
162+
test_http_server(guest_ip)?;
163163
}
164164
"httpd" => test_httpd(guest_ip)?,
165165
"testudp" => test_testudp(guest_ip)?,
@@ -172,7 +172,7 @@ impl Qemu {
172172
.iter()
173173
.flat_map(|s| s.split(&[' ', ','][..]))
174174
.any(|feature| feature == "client");
175-
test_vsock(has_client)?
175+
test_vsock(has_client)?;
176176
}
177177
_ => {}
178178
}
@@ -428,10 +428,10 @@ impl Qemu {
428428
Device::VirtioFsPci => "vhost-user-fs-pci",
429429
_ => unreachable!(),
430430
};
431-
let default_virtio_features = if !self.no_default_virtio_features {
432-
",packed=on"
433-
} else {
431+
let default_virtio_features = if self.no_default_virtio_features {
434432
""
433+
} else {
434+
",packed=on"
435435
};
436436
vec![
437437
"-chardev".to_owned(),

0 commit comments

Comments
 (0)