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:
   7fa1d78c89/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.
This commit is contained in:
Marcel Märtens 2021-01-13 14:22:54 +01:00
parent 11deb97d5a
commit 68be467138

View File

@ -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: