diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-10-15 08:04:08 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-10-15 08:10:17 -0700 |
| commit | 4b44c46432744a4975432eabba16ad60cb39e089 (patch) | |
| tree | ec6e0e84640ffd1fb2aa2c0a20a08a281365af6e /ci | |
| parent | 03f3900fb27099366771f54cec6acd558493a4db (diff) | |
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>
Diffstat (limited to 'ci')
| -rwxr-xr-x | ci/install-dependencies.sh | 2 | ||||
| -rwxr-xr-x | ci/run-rust-checks.sh | 5 |
2 files changed, 6 insertions, 1 deletions
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 |
