Skip to content

Commit 93299d5

Browse files
authored
feat(ci): deny cargo doc warnings (#2192)
* feat(ci): deny cargo doc warnings * fix: doc warnings
1 parent 9273717 commit 93299d5

File tree

11 files changed

+22
-12
lines changed

11 files changed

+22
-12
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
fail-fast: false
2929
matrix:
3030
os: [ubuntu-latest, macos-latest]
31-
name: [build, check-m2-native, check-clippy, check-clippy-verify-signature, test-fvm, test, integration, conformance, calibration, doctest]
31+
name: [build, check-m2-native, check-clippy, check-clippy-verify-signature, test-fvm, test, integration, conformance, calibration, doctest, doc]
3232
include:
3333
- name: build
3434
key: v3
@@ -84,6 +84,10 @@ jobs:
8484
# we disable default features because Rust will otherwise unify them and turn on opencl in CI.
8585
# we also disable test packages, given they are unlikely to contain any doctests and would double the compilation duration
8686
args: --all --no-default-features --exclude fvm_conformance_tests --exclude fvm_integration_tests --exclude "*actor" --doc
87+
- name: doc
88+
key: v3
89+
command: doc
90+
args: --all --no-default-features --exclude fvm_conformance_tests --exclude fvm_integration_tests --exclude "*actor"
8791
exclude:
8892
- os: macos-latest
8993
name: check-m2-native
@@ -99,9 +103,12 @@ jobs:
99103
name: calibration
100104
- os: macos-latest
101105
name: doctest
106+
- os: macos-latest
107+
name: doc
102108
env:
103109
CARGO_INCREMENTAL: 0
104110
CARGO_TERM_COLOR: always
111+
RUSTDOCFLAGS: "-Dwarnings"
105112
name: ${{matrix.os}} - ${{ matrix.name }}
106113
steps:
107114
- name: Checking out fvm

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
all: build
2-
.PHONY: all
32

43
build:
54
cargo build
6-
.PHONY: build
75

86
clean:
97
cargo clean
@@ -18,3 +16,8 @@ license:
1816
doctest:
1917
# We disable test packages, given they are unlikely to contain any doctests and would double the compilation duration.
2018
cargo test --all --exclude fvm_conformance_tests --exclude fvm_integration_tests --exclude "*actor" --doc
19+
20+
doc:
21+
RUSTDOCFLAGS="-D warnings" cargo doc --all --no-default-features --exclude fvm_conformance_tests --exclude fvm_integration_tests --exclude "*actor"
22+
23+
.PHONY: all build clean lint license doctest doc

fvm/src/account_actor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//! ## Future direction
77
//!
88
//! This coupling between the FVM and a concrete actor must eventually be
9-
//! eliminated. Refer to https://github.com/filecoin-project/fvm/issues/229 for
9+
//! eliminated. Refer to <https://github.com/filecoin-project/fvm/issues/229> for
1010
//! details.
1111
1212
use fvm_ipld_encoding::tuple::*;

fvm/src/gas/timer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ struct GasTimerInner {
6565
impl GasTimer {
6666
/// Convenience method to start measuring time before the charge is made.
6767
///
68-
/// Use the return value with [GasTimer::finish_with] to override the internal
68+
/// Use the return value with [GasTimer::stop_with] to override the internal
6969
/// instant that the timer was started with.
7070
pub fn start() -> GasInstant {
7171
GasInstant::now()

fvm/src/syscalls/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub enum Abort {
2222
OutOfGas,
2323
/// The system failed with a fatal error indicating a bug in the FVM. This will abort the entire
2424
/// top-level message and record a
25-
/// [`SYS_ASSERTION_FAILED`][fvm_shared::ExitCode::SYS_ASSERTION_FAILED] exit code on-chain.
25+
/// [`SYS_ASSERTION_FAILED`][fvm_shared::error::ExitCode::SYS_ASSERTION_FAILED] exit code on-chain.
2626
#[error("fatal error: {0}")]
2727
Fatal(anyhow::Error),
2828
}

ipld/amt/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//! AMT crate for use as rust IPLD data structure
66
//!
77
//! Data structure reference:
8-
//! https://github.com/ipld/specs/blob/51fab05b4fe4930d3d851d50cc1e5f1a02092deb/data-structures/vector.md
8+
//! <https://github.com/ipld/specs/blob/51fab05b4fe4930d3d851d50cc1e5f1a02092deb/data-structures/vector.md>
99
1010
mod amt;
1111
mod diff;

ipld/bitfield/src/rleplus/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
//! # RLE+ Bitset Encoding
66
//!
7-
//! (from https://github.com/filecoin-project/specs/blob/master/src/listings/data_structures.md)
7+
//! (from <https://github.com/filecoin-project/specs/blob/master/src/listings/data_structures.md>)
88
//!
99
//! RLE+ is a lossless compression format based on [RLE](https://en.wikipedia.org/wiki/Run-length_encoding).
1010
//! Its primary goal is to reduce the size in the case of many individual bits, where RLE breaks down quickly,

sdk/src/message.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub fn gas_premium() -> TokenAmount {
5757
MESSAGE_CONTEXT.gas_premium.into()
5858
}
5959

60-
/// Returns the message parameters as an Option<IpldBlock>.
60+
/// Returns the message parameters as an [`Option<IpldBlock>`].
6161
pub fn params_raw(id: BlockId) -> SyscallResult<Option<IpldBlock>> {
6262
if id == NO_DATA_BLOCK_ID {
6363
return Ok(None);

sdk/src/sys/actor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ super::fvm_syscalls! {
9898
///
9999
/// # Arguments
100100
///
101-
/// - `typ` specifies the builtin-actor [`Type`] to lookup.
101+
/// - `typ` specifies the builtin-actor to lookup.
102102
/// - `obuf_off` and `obuf_len` specify the location and length of a byte buffer into which the
103103
/// FVM will write the s code CID.
104104
///

sdk/src/sys/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
//!
2121
//! ## Kind 1: Divergent
2222
//!
23-
//! Syscalls that return `!` (e.g. [`vm::abort`]) have the signature:
23+
//! Syscalls that return `!` (e.g. [`crate::vm::abort`]) have the signature:
2424
//!
2525
//! ```wat
2626
//! (func $name (param ...) ... (result i32))

0 commit comments

Comments
 (0)