Skip to content

Commit

Permalink
chore: Use fixed Rust version for clippy (and fmt) (#413)
Browse files Browse the repository at this point in the history
In Rust 1.69.0, the `almost_swapped` lint was enhanced and now triggers
on the clap 3.x `Subcommand` derive macro. Unfortunately the macro
includes `#[deny(clippy::correctness)]` (which implies denying
`almost_swapped`), and so it can't be overridden.

This issue doesn't exist in clap 4.x, it was fixed already.

Until either the fix is backported to clap 3.x or we switch to clap
4.x., this change fixes the Rust version used for clippy (and by
extension rustfmt) to the previous version 1.68.2.

Co-authored-by: Eliza Weisman <eliza@buoyant.io>
  • Loading branch information
hds and hawkw committed Sep 29, 2023
1 parent f280df9 commit a5454a5
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ env:
RUSTUP_MAX_RETRIES: 10
# Don't emit giant backtraces in the CI logs.
RUST_BACKTRACE: short
# Use Rust 1.68.2 for Clippy (and fmt) because of an enhanced `almost_swapped`
# lint in 1.69.0 which affects clap 3 and can't be `allow`ed.
RUST_FMT_CLIPPY: 1.68.2


jobs:
check:
Expand Down Expand Up @@ -105,14 +109,11 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
- name: Install Rust ${{ env.RUST_FMT_CLIPPY }}
uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v1
toolchain: ${{ env.RUST_FMT_CLIPPY }}
components: clippy, rustfmt

- name: Run cargo fmt
uses: actions-rs/cargo@v1
Expand Down

0 comments on commit a5454a5

Please sign in to comment.