git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 4/6] ci: check for common Rust mistakes via Clippy

From
Patrick Steinhardt <ps@pks.im>
Date
Oct 8, 2025, 06:27 UTC
Message-ID
<20251008-b4-pks-ci-rust-v2-4-d556ee83c381@pks.im>
In-Reply-To
<20251008-b4-pks-ci-rust-v2-0-d556ee83c381@pks.im>

Introduce a CI check that uses Clippy to perform checks for common mistakes and suggested code improvements. Clippy is the official static analyser of the Rust project and thus the de-facto standard.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 ci/install-dependencies.sh | 2 +-
 ci/run-rust-checks.sh      | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh
index a24b07edff..dcd22ddd95 100755
--- a/ci/install-dependencies.sh
+++ b/ci/install-dependencies.sh
@@ -129,7 +129,7 @@ StaticAnalysis)
 RustAnalysis)
 	sudo apt-get -q -y install rustup
 	rustup default stable
-	rustup component add rustfmt
+	rustup component add clippy rustfmt
 	;;
 sparse)
 	sudo apt-get -q -y install libssl-dev libcurl4-openssl-dev \
diff --git a/ci/run-rust-checks.sh b/ci/run-rust-checks.sh
index 082eb52f11..fb5ea8991b 100755
--- a/ci/run-rust-checks.sh
+++ b/ci/run-rust-checks.sh
@@ -9,4 +9,9 @@ then
 	RET=1
 fi
 
+if ! group "Check for common Rust mistakes" cargo clippy --all-targets --all-features -- -Dwarnings
+then
+	RET=1
+fi
+
 exit $RET
-- 
2.51.0.764.g787ff6f08a.dirty
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 5 of 9 in “ci: improvements to our Rust infrastructure”
  1. 0/6 ci: improvements to our Rust infrastructurePatrick Steinhardt, Oct 8, 2025
  2. 1/6 ci: deduplicate calls to `apt-get update`Patrick Steinhardt, Oct 8, 2025
  3. 2/6 ci: check formatting of our Rust codePatrick Steinhardt, Oct 8, 2025
  4. 3/6 rust/varint: add safety commentsPatrick Steinhardt, Oct 8, 2025
  5. 4/6 ci: check for common Rust mistakes via ClippyPatrick Steinhardt, Oct 8, 2025
  6. 5/6 ci: verify minimum supported Rust versionPatrick Steinhardt, Oct 8, 2025
  7. 6/6 rust: support for WindowsPatrick Steinhardt, Oct 8, 2025
  8. Patrick SteinhardtOct 8, 2025
  9. Junio C HamanoOct 9, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.