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>
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 \
RET=1
fi
+if ! group "Check for common Rust mistakes" cargo clippy --all-targets --all-features -- -Dwarnings
+then
+ RET=1
+fi
+
exit $RET