Skip to content

Commit b203e31

Browse files
committed
Merge #2158: ci: check-docs for all workspace packages
9c8b564 fix(docs): in keychain_txout.rs and spk_client.rs (shinigami-777) 19d1269 ci: add new check-docs job, justfile recipe and documentation (shinigami-777) Pull request description: fixes #2152 ### Description This PR adds new CI job `check-docs` to validate that documentation builds for all workspace packages, also adds a new justfile recipe `just doc`. It also fixes the existing errors in `bdk_chain` and `bdk_core`. ### Changelog notice ``` ### Added - ci: add new `check-docs` job. ### Changed - fix(docs): in `keychain_txout.rs` and `spk_client.rs` ``` ### Checklists #### All Submissions: * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md) #### New Features: * [ ] I've added tests for the new feature * [x] I've added docs for the new feature #### Bugfixes: * [ ] This pull request breaks the existing API * [ ] I've added tests to reproduce the issue which are now passing * [x] I'm linking the issue being fixed by this PR ACKs for top commit: oleonardolima: ACK 9c8b564 Tree-SHA512: ce072647410ba577f28317f1f64c28576517ad29115db09e8231cb756a0e70dcbbe162592b7ab2cad73a67b0db8f727d48dc775817c2530d9f3c83f75832d859
2 parents 0f89edb + 9c8b564 commit b203e31

5 files changed

Lines changed: 27 additions & 5 deletions

File tree

.github/workflows/cont_integration.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,3 +166,21 @@ jobs:
166166
- name: Build
167167
working-directory: examples/${{ matrix.example-dir }}
168168
run: cargo build
169+
170+
check-docs:
171+
needs: prepare
172+
name: Check documentation errors
173+
runs-on: ubuntu-latest
174+
steps:
175+
- name: Checkout
176+
uses: actions/checkout@v6
177+
with:
178+
persist-credentials: false
179+
- name: Install Rust toolchain
180+
uses: actions-rust-lang/setup-rust-toolchain@v1
181+
with:
182+
toolchain: ${{ needs.prepare.outputs.rust_version }}
183+
override: true
184+
cache: true
185+
- name: Check docs
186+
run: RUSTDOCFLAGS='-D warnings' cargo doc --workspace --no-deps

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Coding Conventions
8787
------------------
8888

8989
This codebase uses spaces, not tabs.
90-
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.
90+
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.
9191
This is also enforced by the CI.
9292
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.
9393

crates/chain/src/indexer/keychain_txout.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,13 +1096,13 @@ impl Merge for ChangeSet {
10961096

10971097
/// Trait to extend [`SyncRequestBuilder`].
10981098
pub trait SyncRequestBuilderExt<K> {
1099-
/// Add [`Script`](bitcoin::Script)s that are revealed by the `indexer` of the given `spk_range`
1099+
/// Add [`Script`]s that are revealed by the `indexer` of the given `spk_range`
11001100
/// that will be synced against.
11011101
fn revealed_spks_from_indexer<R>(self, indexer: &KeychainTxOutIndex<K>, spk_range: R) -> Self
11021102
where
11031103
R: core::ops::RangeBounds<K>;
11041104

1105-
/// Add [`Script`](bitcoin::Script)s that are revealed by the `indexer` but currently unused.
1105+
/// Add [`Script`]s that are revealed by the `indexer` but currently unused.
11061106
fn unused_spks_from_indexer(self, indexer: &KeychainTxOutIndex<K>) -> Self;
11071107
}
11081108

crates/core/src/spk_client.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,7 @@ impl<I, D> SyncRequestBuilder<I, D> {
137137
/// # Example
138138
///
139139
/// Sync revealed script pubkeys obtained from a
140-
/// [`KeychainTxOutIndex`](../../bdk_chain/indexer/keychain_txout/struct.KeychainTxOutIndex.
141-
/// html).
140+
/// [`KeychainTxOutIndex`](https://docs.rs/bdk_chain/latest/bdk_chain/indexer/keychain_txout/struct.KeychainTxOutIndex.html).
142141
///
143142
/// ```rust
144143
/// # use bdk_chain::bitcoin::BlockHash;

justfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ alias c := check
33
alias f := fmt
44
alias t := test
55
alias p := pre-push
6+
alias d := doc
67

78
_default:
89
@just --list
@@ -57,3 +58,7 @@ _test-testenv:
5758

5859
# Run pre-push suite: format, check, and test
5960
pre-push: fmt check test
61+
62+
# Check documentation for all workspace packages
63+
doc:
64+
RUSTDOCFLAGS='-D warnings' cargo doc --workspace --no-deps

0 commit comments

Comments
 (0)