From 28f3f3c9c9e5a39bec69a0cd92e21eaf7779ebb7 Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Sat, 28 Nov 2020 15:33:39 +0100 Subject: [PATCH] Add Clippy linter step to CICD Run the linter on the minimum supported rust version; otherwise we will get lint warnings for things that require a too high Rust toolchain version to fix. Allow the following checks, since we already violate them our code: - clippy::new-without-default - clippy::match-bool - clippy::if_same_then_else Eventually we should fix these lint issues and then disallow them to prevent them from coming back in other places. The clippy args used is recommended here: https://github.com/rust-lang/rust-clippy#travis-ci --- .github/workflows/CICD.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index c4bb4ba0..52f01c0b 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -22,6 +22,12 @@ jobs: toolchain: ${{ env.MIN_SUPPORTED_RUST_VERSION }} default: true profile: minimal # minimal component installation (ie, no documentation) + components: clippy + - name: Run clippy (on minimum supported rust version to prevent warnings we can't fix) + uses: actions-rs/cargo@v1 + with: + command: clippy + args: --all-targets --all-features -- --deny warnings --allow clippy::new-without-default --allow clippy::match-bool --allow clippy::if_same_then_else - name: Test uses: actions-rs/cargo@v1 with: