From 32f2b0ac69dfd86d3702a036128cb6d84b7bb3ce Mon Sep 17 00:00:00 2001 From: Fmt Bot Date: Sun, 27 Sep 2026 02:54:35 +0000 Subject: [PATCH 1/3] 2026-09-27 automated rustfmt nightly --- ldk-server-cli/src/pay_wait.rs | 4 ++-- ldk-server-grpc/src/grpc.rs | 6 ++++-- ldk-server-macaroons/src/macaroon.rs | 3 ++- ldk-server/src/util/config.rs | 5 +++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ldk-server-cli/src/pay_wait.rs b/ldk-server-cli/src/pay_wait.rs index f5032a03..62a89e89 100644 --- a/ldk-server-cli/src/pay_wait.rs +++ b/ldk-server-cli/src/pay_wait.rs @@ -12,9 +12,9 @@ use std::time::Duration; use ldk_server_client::client::{EventStream, LdkServerClient}; use ldk_server_client::error::LdkServerError; use ldk_server_client::error::LdkServerErrorCode::InternalError; -use ldk_server_client::ldk_server_grpc::api::unified_send_response; use ldk_server_client::ldk_server_grpc::api::{ - GetPaymentDetailsRequest, GetPaymentDetailsResponse, UnifiedSendRequest, UnifiedSendResponse, + unified_send_response, GetPaymentDetailsRequest, GetPaymentDetailsResponse, UnifiedSendRequest, + UnifiedSendResponse, }; use ldk_server_client::ldk_server_grpc::events::event_envelope::Event; diff --git a/ldk-server-grpc/src/grpc.rs b/ldk-server-grpc/src/grpc.rs index 06deb959..64f13f9e 100644 --- a/ldk-server-grpc/src/grpc.rs +++ b/ldk-server-grpc/src/grpc.rs @@ -402,8 +402,10 @@ mod tests { let s = String::from(b as char); let encoded = percent_encode(&s); let is_unreserved = b.is_ascii_alphanumeric() - || b == b'-' || b == b'_' - || b == b'.' || b == b'~' + || b == b'-' + || b == b'_' + || b == b'.' + || b == b'~' || b == b' '; if is_unreserved { assert_eq!(encoded, s, "byte {b:#04x} ({}) should pass through", b as char); diff --git a/ldk-server-macaroons/src/macaroon.rs b/ldk-server-macaroons/src/macaroon.rs index 8982bf1e..148af5e6 100644 --- a/ldk-server-macaroons/src/macaroon.rs +++ b/ldk-server-macaroons/src/macaroon.rs @@ -13,7 +13,8 @@ //! Third-party caveats and other formats are rejected. //! Format: . -use bitcoin_hashes::{cmp::fixed_time_eq, hmac, sha256, Hash, HashEngine}; +use bitcoin_hashes::cmp::fixed_time_eq; +use bitcoin_hashes::{hmac, sha256, Hash, HashEngine}; use hex_conservative::{DisplayHex, FromHex}; /// Maximum binary token size. Hex transport uses twice this many bytes. diff --git a/ldk-server/src/util/config.rs b/ldk-server/src/util/config.rs index d09bfdf3..16910f06 100644 --- a/ldk-server/src/util/config.rs +++ b/ldk-server/src/util/config.rs @@ -580,7 +580,8 @@ impl ConfigBuilder { self.log_max_size_mb.unwrap_or(DEFAULT_LOG_MAX_SIZE_MB) * 1024 * 1024; let log_rotation_interval_secs = self.log_rotation_interval_hours.unwrap_or(DEFAULT_LOG_ROTATION_INTERVAL_HOURS) - * 60 * 60; + * 60 + * 60; let log_max_files = self.log_max_files.unwrap_or(DEFAULT_LOG_MAX_FILES); let log_to_file = self.log_to_file.unwrap_or(true); @@ -2321,7 +2322,7 @@ mod tests { r#" [node] network = "regtest" - + [bitcoind] rpc_address = "127.0.0.1:8332" rpc_user = "bitcoind-testuser" From b403fca988f2e6ffc927892d943748c23361acd8 Mon Sep 17 00:00:00 2001 From: benthecarman Date: Mon, 28 Sep 2026 18:35:00 -0500 Subject: [PATCH 2/3] Reformat binop chains with stable rustfmt Nightly rustfmt wrapped these operator chains differently than stable, which CI uses for its format check. Restore the stable layout so the check passes. Co-Authored-By: Claude Opus 5.5 --- ldk-server-grpc/src/grpc.rs | 6 ++---- ldk-server/src/util/config.rs | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/ldk-server-grpc/src/grpc.rs b/ldk-server-grpc/src/grpc.rs index 64f13f9e..06deb959 100644 --- a/ldk-server-grpc/src/grpc.rs +++ b/ldk-server-grpc/src/grpc.rs @@ -402,10 +402,8 @@ mod tests { let s = String::from(b as char); let encoded = percent_encode(&s); let is_unreserved = b.is_ascii_alphanumeric() - || b == b'-' - || b == b'_' - || b == b'.' - || b == b'~' + || b == b'-' || b == b'_' + || b == b'.' || b == b'~' || b == b' '; if is_unreserved { assert_eq!(encoded, s, "byte {b:#04x} ({}) should pass through", b as char); diff --git a/ldk-server/src/util/config.rs b/ldk-server/src/util/config.rs index 16910f06..0ef844ca 100644 --- a/ldk-server/src/util/config.rs +++ b/ldk-server/src/util/config.rs @@ -580,8 +580,7 @@ impl ConfigBuilder { self.log_max_size_mb.unwrap_or(DEFAULT_LOG_MAX_SIZE_MB) * 1024 * 1024; let log_rotation_interval_secs = self.log_rotation_interval_hours.unwrap_or(DEFAULT_LOG_ROTATION_INTERVAL_HOURS) - * 60 - * 60; + * 60 * 60; let log_max_files = self.log_max_files.unwrap_or(DEFAULT_LOG_MAX_FILES); let log_to_file = self.log_to_file.unwrap_or(true); From 606a0cf851f80d973ab176ac01073636dc518bb1 Mon Sep 17 00:00:00 2001 From: benthecarman Date: Mon, 28 Sep 2026 18:30:57 -0500 Subject: [PATCH 3/3] Run stable rustfmt after nightly in fmt cron The weekly cron formats with nightly rustfmt, but CI checks formatting with stable. The two can disagree on layout (e.g. how binary operator chains are wrapped), so the bot's PRs fail the stable fmt check and check-protos. Run stable rustfmt after nightly so the nightly-only options from rustfmt.toml (import granularity and grouping) are still applied, but the final layout always matches what CI expects. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/cron-weekly-rustfmt.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cron-weekly-rustfmt.yml b/.github/workflows/cron-weekly-rustfmt.yml index ec5b69b6..2bb81b80 100644 --- a/.github/workflows/cron-weekly-rustfmt.yml +++ b/.github/workflows/cron-weekly-rustfmt.yml @@ -14,12 +14,18 @@ jobs: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v6 - - uses: dtolnay/rust-toolchain@nightly - with: - components: rustfmt + - name: Install stable and nightly rustfmt + run: rustup toolchain install stable nightly --profile minimal --component rustfmt - name: Run Nightly rustfmt - # Run the formatter and manually remove trailing whitespace. - run: cargo +nightly fmt && cargo +nightly fmt --manifest-path e2e-tests/Cargo.toml && git ls-files -- '*.rs' -z | xargs sed -E -i'' -e 's/[[:space:]]+$//' + # Run nightly to apply the nightly-only options (e.g. import grouping), + # then stable so the result matches the stable `--check` in CI, and + # manually remove trailing whitespace. + run: | + cargo +nightly fmt --all + cargo +nightly fmt --manifest-path e2e-tests/Cargo.toml --all + cargo +stable fmt --all + cargo +stable fmt --manifest-path e2e-tests/Cargo.toml --all + git ls-files -- '*.rs' -z | xargs -0 sed -E -i'' -e 's/[[:space:]]+$//' - name: Get the current date run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_ENV - name: Create Pull Request