# HG changeset patch # User Raphaël Gomès # Date 1673347193 -3600 # Node ID 0a58aaa2009c883973131ab87e16ff22303b2a10 # Parent e3274e02d08ebe7a85ada43d3f392da73d07dfa3 makefile: add `cargo clippy` to tests if cargo is available This linter mostly makes our code more idiomatic, less surprising, has good suggestions and catches bugs. It's widely used in the Rust community and now part of the default toolchain when using `rustup`. diff -r e3274e02d08e -r 0a58aaa2009c Makefile --- a/Makefile Tue Jan 10 11:25:24 2023 +0100 +++ b/Makefile Tue Jan 10 11:39:53 2023 +0100 @@ -138,6 +138,7 @@ # Run Rust tests if cargo is installed if command -v $(CARGO) >/dev/null 2>&1; then \ $(MAKE) rust-tests; \ + $(MAKE) cargo-clippy; \ fi cd tests && $(PYTHON) run-tests.py $(TESTFLAGS) @@ -155,6 +156,10 @@ cd $(HGROOT)/rust \ && $(CARGO) test --quiet --all --features "$(HG_RUST_FEATURES)" +cargo-clippy: + cd $(HGROOT)/rust \ + && $(CARGO) clippy --all --features "$(HG_RUST_FEATURES)" + check-code: hg manifest | xargs python contrib/check-code.py