[Virtio-fs] [virtiofsd-rs] MR opened: Fail CI when clippy warns

virtiofs-bot at sinrega.org virtiofs-bot at sinrega.org
Wed Apr 21 17:13:56 UTC 2021


Hi,

Clippy is part of our CI, but its warnings are ignored, because it does not exit with a non-zero status when there are only warnings (but no errors).  Considering that rustfmt is part of our CI, too, I believe clippy’s warnings should count as errors for the CI.

I’m not sure, though, so perhaps this merge request is in fact not something that we really want.  One problem I can see is that clippy’s warnings seem to differ between versions quite starkly, so it may happen that clippy gets a new warning and suddenly all new merge requests fail even though it’s not their fault.  Another problem may be that people don’t always agree with clippy, but, well, I also often disagree with rustfmt, but it’s still part of the CI, so.

As far as I’m aware, the simplest way to make clippy fail on warnings is to pass `-Dwarnings` to `cargo clippy`, so this is what patch 2 does.

Patch 1 fixes all but one of the warnings I’m currently aware of.  That one warning it doesn’t fix occurs in src/main.rs (src/main.rs:386, that should be a `.map(|rules| ...)` instead of a `match { Some(rules) => ... }`), but that piece of code is dropped by merge request 17, and the gitlab clippy doesn’t complain about it (I hope...), so I see no need to touch it here.
---
https://gitlab.com/virtio-fs/virtiofsd-rs/-/merge_requests/23




More information about the Virtio-fs mailing list