From c4b8e93d5dceab959131d6eeec164654d1aa870c Mon Sep 17 00:00:00 2001 From: shinigami-777 Date: Mon, 16 Mar 2026 02:18:52 +0530 Subject: [PATCH 1/2] ci: add new check-docs job, justfile recipe and documentation --- .github/workflows/cont_integration.yml | 18 ++++++++++++++++++ CONTRIBUTING.md | 2 +- justfile | 5 +++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cont_integration.yml b/.github/workflows/cont_integration.yml index 6c8a01ff8..c4f8b5fc2 100644 --- a/.github/workflows/cont_integration.yml +++ b/.github/workflows/cont_integration.yml @@ -166,3 +166,21 @@ jobs: - name: Build working-directory: examples/${{ matrix.example-dir }} run: cargo build + + check-docs: + needs: prepare + name: Check documentation errors + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + - name: Install Rust toolchain + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: ${{ needs.prepare.outputs.rust_version }} + override: true + cache: true + - name: Check docs + run: RUSTDOCFLAGS='-D warnings' cargo doc --workspace --no-deps diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a9a904653..699c824cb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -87,7 +87,7 @@ Coding Conventions ------------------ This codebase uses spaces, not tabs. -Run `just check` to check formatting, linting, compilation and commit signing, `just fmt` to format code before commiting, and `just test` to run tests for all crates. +Run `just check` to check formatting, linting, compilation and commit signing, `just fmt` to format code before commiting, `just test` to run tests for all crates, `just pre-push` to run the full pre-push suite before pushing changes and `just doc` to check documentation build warnings and errors for all packages. This is also enforced by the CI. All public items must be documented. We adhere to the [Rust API Guidelines](https://rust-lang.github.io/api-guidelines/about.html) with respect to documentation. diff --git a/justfile b/justfile index b5ca94d16..7d96010c8 100644 --- a/justfile +++ b/justfile @@ -3,6 +3,7 @@ alias c := check alias f := fmt alias t := test alias p := pre-push +alias d := doc _default: @just --list @@ -57,3 +58,7 @@ _test-testenv: # Run pre-push suite: format, check, and test pre-push: fmt check test + +# Check documentation for all workspace packages +doc: + RUSTDOCFLAGS='-D warnings' cargo doc --workspace --no-deps From 1d1e985eff0073e78df0a511d810ca71ae525932 Mon Sep 17 00:00:00 2001 From: shinigami-777 Date: Thu, 19 Mar 2026 03:20:18 +0530 Subject: [PATCH 2/2] fix(docs): in keychain_txout.rs and spk_client.rs --- crates/chain/src/indexer/keychain_txout.rs | 4 ++-- crates/core/src/spk_client.rs | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/crates/chain/src/indexer/keychain_txout.rs b/crates/chain/src/indexer/keychain_txout.rs index cbad66696..4c40ce734 100644 --- a/crates/chain/src/indexer/keychain_txout.rs +++ b/crates/chain/src/indexer/keychain_txout.rs @@ -1096,13 +1096,13 @@ impl Merge for ChangeSet { /// Trait to extend [`SyncRequestBuilder`]. pub trait SyncRequestBuilderExt { - /// Add [`Script`](bitcoin::Script)s that are revealed by the `indexer` of the given `spk_range` + /// Add [`Script`]s that are revealed by the `indexer` of the given `spk_range` /// that will be synced against. fn revealed_spks_from_indexer(self, indexer: &KeychainTxOutIndex, spk_range: R) -> Self where R: core::ops::RangeBounds; - /// Add [`Script`](bitcoin::Script)s that are revealed by the `indexer` but currently unused. + /// Add [`Script`]s that are revealed by the `indexer` but currently unused. fn unused_spks_from_indexer(self, indexer: &KeychainTxOutIndex) -> Self; } diff --git a/crates/core/src/spk_client.rs b/crates/core/src/spk_client.rs index 8612959cb..c9cabc3e6 100644 --- a/crates/core/src/spk_client.rs +++ b/crates/core/src/spk_client.rs @@ -137,8 +137,7 @@ impl SyncRequestBuilder { /// # Example /// /// Sync revealed script pubkeys obtained from a - /// [`KeychainTxOutIndex`](../../bdk_chain/indexer/keychain_txout/struct.KeychainTxOutIndex. - /// html). + /// [`KeychainTxOutIndex`](https://docs.rs/bdk_chain/latest/bdk_chain/indexer/keychain_txout/struct.KeychainTxOutIndex.html). /// /// ```rust /// # use bdk_chain::bitcoin::BlockHash;