Skip to content

Commit a94fe9a

Browse files
pks-tgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6358a08 commit a94fe9a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

ci/install-dependencies.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ StaticAnalysis)
129129
RustAnalysis)
130130
sudo apt-get -q -y install rustup
131131
rustup default stable
132-
rustup component add rustfmt
132+
rustup component add clippy rustfmt
133133
;;
134134
sparse)
135135
sudo apt-get -q -y install libssl-dev libcurl4-openssl-dev \

ci/run-rust-checks.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,9 @@ then
99
RET=1
1010
fi
1111

12+
if ! group "Check for common Rust mistakes" cargo clippy --all-targets --all-features -- -Dwarnings
13+
then
14+
RET=1
15+
fi
16+
1217
exit $RET

0 commit comments

Comments
 (0)