From d43f63949d0453303db46414218e3b6811ce6655 Mon Sep 17 00:00:00 2001 From: Arowolokehinde Date: Fri, 21 Aug 2026 20:42:28 +0100 Subject: [PATCH] fix(ci): pin nightly toolchain for rustfmt The CI fmt job ran cargo fmt on the stable toolchain resolved from rust-toolchain.toml, so the nightly-only options in rustfmt.toml (wrap_comments, comment_width, format_code_in_doc_comments) were silently ignored and never enforced. PRs could pass CI with formatting that just p would reject locally. Point the fmt job at a pinned nightly (nightly-2026-08-01) with the rustfmt component, and pin the same version in the justfile recipes so CI and local just runs produce identical formatting output. Fixes #535 --- .github/workflows/cont_integration.yml | 6 ++++-- justfile | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cont_integration.yml b/.github/workflows/cont_integration.yml index 0b4816bd..7d316a93 100644 --- a/.github/workflows/cont_integration.yml +++ b/.github/workflows/cont_integration.yml @@ -124,13 +124,15 @@ jobs: uses: actions/checkout@v7 with: persist-credentials: false - # This action automatically reads and applies rust-toolchain.toml + # Pin nightly for rustfmt — rustfmt.toml uses nightly-only options - name: Install Rust toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: + toolchain: nightly-2026-08-01 + components: rustfmt cache: true - name: Check fmt - run: cargo fmt --all --check + run: cargo +nightly-2026-08-01 fmt --all --check clippy_check: name: Rust clippy diff --git a/justfile b/justfile index 1a9f53c0..de238bae 100644 --- a/justfile +++ b/justfile @@ -19,14 +19,14 @@ build: # Check formatting, compilation, linting _check: - cargo +nightly fmt --all -- --check + cargo +nightly-2026-08-01 fmt --all -- --check RUSTFLAGS="" cargo check --all-targets --no-default-features --features miniscript/no-std,bdk_chain/hashbrown RUSTFLAGS="" cargo check --all-targets --features {{FEATURES}} RUSTFLAGS="-D warnings" cargo clippy --all-targets --features {{FEATURES}} # Check formatting, compilation, linting of the unstable API surface _check-unstable: - cargo +nightly fmt --all -- --check + cargo +nightly-2026-08-01 fmt --all -- --check RUSTFLAGS="--cfg bdk_wallet_unstable" cargo check --all-targets --no-default-features --features miniscript/no-std,bdk_chain/hashbrown RUSTFLAGS="--cfg bdk_wallet_unstable" cargo check --all-targets --all-features RUSTFLAGS="--cfg bdk_wallet_unstable -D warnings" cargo clippy --all-targets --all-features @@ -39,7 +39,7 @@ check: _check _check-unstable # Format all code fmt: - cargo +nightly fmt + cargo +nightly-2026-08-01 fmt # Run tests on the stable API surface _test: