Skip to content

Commit

Permalink
docs: enable some useful rustdoc features on docs.rs (#1890)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes authored Jan 5, 2025
1 parent 9360051 commit 6a7e3eb
Show file tree
Hide file tree
Showing 39 changed files with 211 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ jobs:
- name: Build documentation
run: cargo doc --workspace --all-features --no-deps --document-private-items
env:
RUSTDOCFLAGS: --cfg docsrs -D warnings --show-type-layout --generate-link-to-definition -Zunstable-options
RUSTDOCFLAGS: --cfg docsrs -D warnings -Zunstable-options --show-type-layout --generate-link-to-definition

fmt:
runs-on: ubuntu-latest
Expand Down
4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ use-self = "warn"
option-if-let-else = "warn"
redundant-clone = "warn"

[workspace.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[workspace.dependencies]
alloy-consensus = { version = "0.9", path = "crates/consensus", default-features = false }
alloy-consensus-any = { version = "0.9", path = "crates/consensus-any", default-features = false }
Expand Down
6 changes: 5 additions & 1 deletion crates/alloy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ exclude.workspace = true

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
rustdoc-args = [
"-Zunstable-options",
"--generate-link-to-definition",
"--show-type-layout",
]

[lints]
workspace = true
Expand Down
6 changes: 5 additions & 1 deletion crates/consensus-any/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ exclude.workspace = true

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
rustdoc-args = [
"-Zunstable-options",
"--generate-link-to-definition",
"--show-type-layout",
]

[lints]
workspace = true
Expand Down
6 changes: 5 additions & 1 deletion crates/consensus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ exclude.workspace = true

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
rustdoc-args = [
"-Zunstable-options",
"--generate-link-to-definition",
"--show-type-layout",
]

[lints]
workspace = true
Expand Down
6 changes: 5 additions & 1 deletion crates/contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ exclude.workspace = true

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
rustdoc-args = [
"-Zunstable-options",
"--generate-link-to-definition",
"--show-type-layout",
]

[lints]
workspace = true
Expand Down
8 changes: 8 additions & 0 deletions crates/eip5792/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ homepage.workspace = true
repository.workspace = true
exclude.workspace = true

[package.metadata.docs.rs]
all-features = true
rustdoc-args = [
"-Zunstable-options",
"--generate-link-to-definition",
"--show-type-layout",
]

[dependencies]
alloy-primitives = { workspace = true, features = ["serde", "map"] }
alloy-serde.workspace = true
Expand Down
6 changes: 5 additions & 1 deletion crates/eip7547/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ exclude.workspace = true

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
rustdoc-args = [
"-Zunstable-options",
"--generate-link-to-definition",
"--show-type-layout",
]

[lints]
workspace = true
Expand Down
26 changes: 20 additions & 6 deletions crates/eips/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ exclude.workspace = true

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
rustdoc-args = [
"-Zunstable-options",
"--generate-link-to-definition",
"--show-type-layout",
]

[lints]
workspace = true
Expand Down Expand Up @@ -49,7 +53,6 @@ ethereum_ssz = { workspace = true, optional = true }
# arbitrary
arbitrary = { workspace = true, features = ["derive"], optional = true }


[dev-dependencies]
alloy-primitives = { workspace = true, features = [
"rand",
Expand All @@ -62,10 +65,21 @@ rand.workspace = true

[features]
default = ["std", "kzg-sidecar"]
std = ["alloy-primitives/std", "alloy-rlp/std",
"serde?/std", "c-kzg?/std", "once_cell?/std"]
serde = ["dep:alloy-serde", "dep:serde", "alloy-primitives/serde",
"c-kzg?/serde", "alloy-eip2930/serde", "alloy-eip7702/serde"]
std = [
"alloy-primitives/std",
"alloy-rlp/std",
"serde?/std",
"c-kzg?/std",
"once_cell?/std",
]
serde = [
"dep:alloy-serde",
"dep:serde",
"alloy-primitives/serde",
"c-kzg?/serde",
"alloy-eip2930/serde",
"alloy-eip7702/serde",
]
serde-bincode-compat = ["alloy-eip7702/serde-bincode-compat"]
kzg = ["kzg-sidecar", "sha2", "dep:c-kzg", "dep:once_cell"]
kzg-sidecar = ["sha2"]
Expand Down
6 changes: 5 additions & 1 deletion crates/genesis/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ exclude.workspace = true

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
rustdoc-args = [
"-Zunstable-options",
"--generate-link-to-definition",
"--show-type-layout",
]

[lints]
workspace = true
Expand Down
6 changes: 5 additions & 1 deletion crates/json-rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ exclude.workspace = true

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
rustdoc-args = [
"-Zunstable-options",
"--generate-link-to-definition",
"--show-type-layout",
]

[lints]
workspace = true
Expand Down
6 changes: 5 additions & 1 deletion crates/network-primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ exclude.workspace = true

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
rustdoc-args = [
"-Zunstable-options",
"--generate-link-to-definition",
"--show-type-layout",
]

[lints]
workspace = true
Expand Down
6 changes: 5 additions & 1 deletion crates/network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ exclude.workspace = true

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
rustdoc-args = [
"-Zunstable-options",
"--generate-link-to-definition",
"--show-type-layout",
]

[lints]
workspace = true
Expand Down
6 changes: 5 additions & 1 deletion crates/node-bindings/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ exclude.workspace = true

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
rustdoc-args = [
"-Zunstable-options",
"--generate-link-to-definition",
"--show-type-layout",
]

[lints]
workspace = true
Expand Down
6 changes: 5 additions & 1 deletion crates/provider/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ exclude.workspace = true

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
rustdoc-args = [
"-Zunstable-options",
"--generate-link-to-definition",
"--show-type-layout",
]

[lints]
workspace = true
Expand Down
6 changes: 5 additions & 1 deletion crates/pubsub/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ exclude.workspace = true

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
rustdoc-args = [
"-Zunstable-options",
"--generate-link-to-definition",
"--show-type-layout",
]

[lints]
workspace = true
Expand Down
6 changes: 5 additions & 1 deletion crates/rpc-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ exclude.workspace = true

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
rustdoc-args = [
"-Zunstable-options",
"--generate-link-to-definition",
"--show-type-layout",
]

[lints]
workspace = true
Expand Down
6 changes: 5 additions & 1 deletion crates/rpc-types-admin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ exclude.workspace = true

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
rustdoc-args = [
"-Zunstable-options",
"--generate-link-to-definition",
"--show-type-layout",
]

[lints]
workspace = true
Expand Down
6 changes: 5 additions & 1 deletion crates/rpc-types-anvil/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ exclude.workspace = true

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
rustdoc-args = [
"-Zunstable-options",
"--generate-link-to-definition",
"--show-type-layout",
]

[lints]
workspace = true
Expand Down
6 changes: 5 additions & 1 deletion crates/rpc-types-any/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ exclude.workspace = true

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
rustdoc-args = [
"-Zunstable-options",
"--generate-link-to-definition",
"--show-type-layout",
]

[lints]
workspace = true
Expand Down
6 changes: 5 additions & 1 deletion crates/rpc-types-beacon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ exclude.workspace = true

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
rustdoc-args = [
"-Zunstable-options",
"--generate-link-to-definition",
"--show-type-layout",
]

[lints]
workspace = true
Expand Down
6 changes: 5 additions & 1 deletion crates/rpc-types-debug/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ exclude.workspace = true

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
rustdoc-args = [
"-Zunstable-options",
"--generate-link-to-definition",
"--show-type-layout",
]

[lints]
workspace = true
Expand Down
6 changes: 5 additions & 1 deletion crates/rpc-types-engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ exclude.workspace = true

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
rustdoc-args = [
"-Zunstable-options",
"--generate-link-to-definition",
"--show-type-layout",
]

[lints]
workspace = true
Expand Down
6 changes: 5 additions & 1 deletion crates/rpc-types-eth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ exclude.workspace = true

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
rustdoc-args = [
"-Zunstable-options",
"--generate-link-to-definition",
"--show-type-layout",
]

[lints]
workspace = true
Expand Down
6 changes: 5 additions & 1 deletion crates/rpc-types-mev/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ exclude.workspace = true

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
rustdoc-args = [
"-Zunstable-options",
"--generate-link-to-definition",
"--show-type-layout",
]

[dependencies]
alloy-eips = { workspace = true, features = ["serde"] }
Expand Down
6 changes: 5 additions & 1 deletion crates/rpc-types-trace/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ exclude.workspace = true

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
rustdoc-args = [
"-Zunstable-options",
"--generate-link-to-definition",
"--show-type-layout",
]

[lints]
workspace = true
Expand Down
6 changes: 5 additions & 1 deletion crates/rpc-types-txpool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ exclude.workspace = true

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
rustdoc-args = [
"-Zunstable-options",
"--generate-link-to-definition",
"--show-type-layout",
]

[lints]
workspace = true
Expand Down
Loading

0 comments on commit 6a7e3eb

Please sign in to comment.