ci: check for common Rust mistakes via Clippy
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> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Patrick Steinhardt committed
Oct 15, 2025 at 08:04 UTC
4b44c46432744a4975432eabba16ad60cb39e089
2 files changed
+6
-1
ci/install-dependencies.sh
+1
-1
@@ -129,7 +129,7 @@ StaticAnalysis)
129
RustAnalysis)
130
sudo apt-get -q -y install rustup
131
rustup default stable
132
- rustup component add rustfmt
132
+ rustup component add clippy rustfmt
133
;;
134
sparse)
135
sudo apt-get -q -y install libssl-dev libcurl4-openssl-dev \
ci/run-rust-checks.sh
+5
@@ -9,4 +9,9 @@ then
9
RET=1
10
fi
11
12
+if ! group "Check for common Rust mistakes" cargo clippy --all-targets --all-features -- -Dwarnings
13
+then
14
+ RET=1
15
+fi
16
+
17
exit $RET