From 953717e1648359baa8196ae32e01313b82f2561e Mon Sep 17 00:00:00 2001 From: Daniel Mueller Date: Mon, 17 Dec 2018 08:01:26 -0800 Subject: Add clippy target to CI/CD pipeline This patch adds a new target to the pipeline that installs clippy and then uses it to check for various potential problems in the crate. --- nitrocli/ci/gitlab-ci.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'nitrocli/ci') diff --git a/nitrocli/ci/gitlab-ci.yml b/nitrocli/ci/gitlab-ci.yml index 2da774c..d2301a3 100644 --- a/nitrocli/ci/gitlab-ci.yml +++ b/nitrocli/ci/gitlab-ci.yml @@ -13,3 +13,17 @@ build:cargo: - apt-get install --assume-yes libudev-dev libhidapi-dev - rustc --version && cargo --version - cd nitrocli && cargo build --all --verbose + +lint:clippy: + script: + - rustup component add clippy + # First check and build everything but be very permissive. Then clean + # only the nitrocli package artifacts. Lastly check once more, but + # with warnings turned to errors. This last run will only recheck + # nitrocli (everything else is still up-to-date). That procedure is + # necessary because consumed dependencies may emit errors otherwise. + - cd nitrocli + - cargo clippy --all-targets --all-features -- + -A warnings -A clippy::float_cmp -A clippy::cast_ptr_alignment + - cargo clean --package=nitrocli + - cargo clippy --all-targets --all-features -- -D warnings -- cgit v1.2.1