Skip to content

Commit d8bdeff

Browse files
authored
chore: improve docs script and remove warnings (#1011)
1 parent 5e209a1 commit d8bdeff

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

.github/scripts/cargo-doc.sh

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
#!/bin/bash
22

3-
set -e
3+
set -euo pipefail
4+
5+
edr_pkgs=($(
6+
cargo metadata --format-version 1 --no-deps \
7+
| jq -r '.packages[].name | select(startswith("edr_"))'
8+
))
9+
10+
foundry_pkgs=($(
11+
cargo metadata --format-version 1 --no-deps \
12+
| jq -r --arg path "$PWD/crates/foundry/" \
13+
'.packages[] | select(.manifest_path | startswith($path)) | .id'
14+
))
415

516
# For EDR crates, test that docs build and they don't have warnings
6-
for dir in crates/edr_*/ ; do
7-
if [ -d "$dir" ]; then
8-
pushd "$dir" > /dev/null
9-
RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features
10-
popd > /dev/null
11-
fi
12-
done
17+
RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features "${edr_pkgs[@]/#/--package=}"
1318

1419
# For Foundry crates, only test that docs build and allow linking to private items
15-
for dir in crates/foundry/* ; do
16-
if [ -d "$dir" ]; then
17-
pushd "$dir" > /dev/null
18-
cargo doc --all-features --no-deps --document-private-items
19-
popd > /dev/null
20-
fi
21-
done
22-
20+
RUSTDOCFLAGS="-A warnings" cargo doc --no-deps --all-features --document-private-items "${foundry_pkgs[@]/#/--package=}"

0 commit comments

Comments
 (0)