From 68be467138ac645b053e994bb86344b358a85119 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=A4rtens?= Date: Wed, 13 Jan 2021 14:22:54 +0100 Subject: [PATCH] After some discussion with XVar, Song and Yakei we found out that `cargo clippy` is a superset of `cargo check`. There are multiple hints: - one guy in discord https://discord.gg/nWGhnbRb https://discord.com/channels/273534239310479360/335502067432947748/798886188923617290 - a old stackoverflow https://stackoverflow.com/questions/57449356/is-cargo-clippy-a-superset-of-cargo-check which lead us to the source code: https://github.com/rust-lang/rust-clippy/blob/7fa1d78c89f74c73d645901d6ee4728bcd6a72bf/src/main.rs#L73 which either uses `check` or `fix`. cargo fix is documented in the docs with (https://doc.rust-lang.org/cargo/commands/cargo-fix.html) "executing cargo fix will under the hood execute cargo-check(1)." - `cargo clippy` fails after running `cargo check` prob as there is nothing to do. - `cargo clippy --help` points us to `cargo check --help` Thus we are removing `cargo check` from the CI as a seperate check. However `cargo check --examples` did check the examples. In order to have them covered we are also running clippy now for examples, benches and all bins. Also we moved `--locked` from cargo check to clippy. --- .gitlab/CI/check.gitlab-ci.yml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.gitlab/CI/check.gitlab-ci.yml b/.gitlab/CI/check.gitlab-ci.yml index 247df426ff..6cd3dfc639 100644 --- a/.gitlab/CI/check.gitlab-ci.yml +++ b/.gitlab/CI/check.gitlab-ci.yml @@ -1,18 +1,10 @@ -check: - extends: .recompile-branch - stage: check - script: - - ln -s /dockercache/cache-all target - - cargo check --locked - - cargo check --examples --locked - +# cargo clippy is a superset of cargo check, so we don't check manually code-quality: extends: .recompile-branch stage: check script: - ln -s /dockercache/cache-all target - - cargo clippy -- -D warnings - - cargo clippy --tests -- -D warnings + - cargo clippy --tests --examples --benches --bins --locked -- -D warnings - cargo fmt --all -- --check security: