]> git.ipfire.org Git - thirdparty/git.git/commitdiff
ci: check for common Rust mistakes via Clippy
authorPatrick Steinhardt <ps@pks.im>
Wed, 15 Oct 2025 06:04:08 +0000 (08:04 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 15 Oct 2025 15:10:17 +0000 (08:10 -0700)
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>
ci/install-dependencies.sh
ci/run-rust-checks.sh

index a24b07edff83ac901c686d7c04ee6d228e90c74b..dcd22ddd95c75e61c7ac3dd090efae380003b503 100755 (executable)
@@ -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 \
index 082eb52f11199b41e6752b3d41d75e0e8c5b1059..fb5ea8991b8af4f2fcc414da53194ea0d4461536 100755 (executable)
@@ -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