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
commit28f3f3c9c9e5a39bec69a0cd92e21eaf7779ebb7
authorMartin Nordholts <enselic@gmail.com>
dateSat 28 Nov 2020, 15:33 (6 years ago)
parent73d9a95
.github/workflows/CICD.yml+6
@@ -22,6 +22,12 @@ jobs:
2222 toolchain: ${{ env.MIN_SUPPORTED_RUST_VERSION }}
2323 default: true
2424 profile: minimal # minimal component installation (ie, no documentation)
25+ components: clippy
26+ - name: Run clippy (on minimum supported rust version to prevent warnings we can't fix)
27+ uses: actions-rs/cargo@v1
28+ with:
29+ command: clippy
30+ args: --all-targets --all-features -- --deny warnings --allow clippy::new-without-default --allow clippy::match-bool --allow clippy::if_same_then_else
2531 - name: Test
2632 uses: actions-rs/cargo@v1
2733 with: