aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mueller <deso@posteo.net>2018-12-17 08:01:26 -0800
committerDaniel Mueller <deso@posteo.net>2018-12-17 08:01:26 -0800
commit953717e1648359baa8196ae32e01313b82f2561e (patch)
tree7fdbb292c9a593d5f2f9256ce61fb37b686eb53d
parent6e77d001bd7e32120bf6ad426da9c8f10dffc716 (diff)
downloadnitrocli-953717e1648359baa8196ae32e01313b82f2561e.tar.gz
nitrocli-953717e1648359baa8196ae32e01313b82f2561e.tar.bz2
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.
-rw-r--r--nitrocli/ci/gitlab-ci.yml14
1 files changed, 14 insertions, 0 deletions
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