From 14f6e9070ec2c1d4dad6afe32928133eaa0f3f67 Mon Sep 17 00:00:00 2001 From: Daniel Mueller Date: Mon, 17 Dec 2018 18:34:46 -0800 Subject: Enable rustfmt in the CI pipeline This change enables automated code format checking by means of the rustfmt program in the Gitlab CI pipeline. The check is performed in a third job in the hope that this helps identify problems more easily: users can see which of the jobs failed and focus on them in isolation, as opposed to having a single log file or, worse, just the results of the stages up to the first failure. This patch resolves issue #17. --- nitrocli/CHANGELOG.md | 4 ++++ nitrocli/ci/gitlab-ci.yml | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/nitrocli/CHANGELOG.md b/nitrocli/CHANGELOG.md index 6ed2a1d..6eda412 100644 --- a/nitrocli/CHANGELOG.md +++ b/nitrocli/CHANGELOG.md @@ -6,6 +6,10 @@ Unreleased `nitrokey-sys` version `3.4.1` as well as `rand` version `0.4.3` as indirect dependencies - Removed the `hid`, `hidapi-sys` and `pkg-config` dependencies +- Enabled CI pipeline comprising code style conformance checks, linting, + and building of the project +- Added badges indicating pipeline status, current `crates.io` published + version of the crate, and minimum version of `rustc` required 0.1.3 diff --git a/nitrocli/ci/gitlab-ci.yml b/nitrocli/ci/gitlab-ci.yml index d2301a3..c51a6bd 100644 --- a/nitrocli/ci/gitlab-ci.yml +++ b/nitrocli/ci/gitlab-ci.yml @@ -27,3 +27,9 @@ lint:clippy: -A warnings -A clippy::float_cmp -A clippy::cast_ptr_alignment - cargo clean --package=nitrocli - cargo clippy --all-targets --all-features -- -D warnings + +format:rustfmt: + script: + - rustup component add rustfmt + - cd nitrocli + - cargo fmt --all -- --check -- cgit v1.2.1