diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 039926da8..291257477 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -305,16 +305,17 @@ jobs: name: "run clippy" run: | just debug_justfile="${{matrix.debug_justfile}}" profile=${{matrix.profile.name}} \ - ${{matrix.profile.sterile}} cargo clippy --all-targets --all-features -- -D warnings + ${{matrix.profile.sterile}} cargo clippy --workspace --no-deps --all-targets --all-features -- -D warnings - id: "docs" name: "run rustdoc" + if: ${{ matrix.profile.name == 'release' && !contains(github.event.pull_request.labels.*.name, 'disable-docs') }} run: | - RUSTDOCFLAGS="-D warnings" just \ + RUSTDOCFLAGS="-D warnings --document-private-items --allow rustdoc::all" just \ debug_justfile="${{matrix.debug_justfile}}" \ profile=${{matrix.profile.name}} \ target=x86_64-unknown-linux-gnu \ - ${{matrix.profile.sterile}} cargo doc + ${{matrix.profile.sterile}} cargo doc --workspace --no-deps - name: "Setup tmate session for debug" if: ${{ failure() && github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} diff --git a/dpdk/src/lib.rs b/dpdk/src/lib.rs index 4b06491c0..f01bdce13 100644 --- a/dpdk/src/lib.rs +++ b/dpdk/src/lib.rs @@ -29,6 +29,7 @@ #![warn(clippy::all)] #![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic)] #![deny(rustdoc::all)] +#![allow(rustdoc::broken_intra_doc_links)] #![allow(private_bounds)] extern crate alloc; extern crate core; diff --git a/justfile b/justfile index d59b5425d..019917230 100644 --- a/justfile +++ b/justfile @@ -171,9 +171,25 @@ cargo *args: declare -rx RUSTFLAGS="${RUSTFLAGS_DEBUG}" fi - export RUSTDOCFLAGS="${RUSTDOCFLAGS:-} ${RUSTFLAGS} --html-in-header $(pwd)/scripts/doc/custom-header.html" + export RUSTDOCFLAGS="${RUSTDOCFLAGS:-} ${RUSTFLAGS} --html-in-header $(pwd)/scripts/doc/custom-header.html --document-private-items" ./compile-env/bin/cargo "${extra_args[@]}" + +# Here we may list external crates for which we want docs because +# the workspace crates' documentations refer to them. +external := "left-right etherparse dataplane-dpdk-sys" + +# Generate docs for the crates in this project +[script] +docs: + export RUSTDOCFLAGS="--html-in-header $(pwd)/scripts/doc/custom-header.html --document-private-items --allow rustdoc::all" + for crate in {{ external }}; do + echo "Documenting $crate..." + ./compile-env/bin/cargo doc -p $crate --no-deps + done + ./compile-env/bin/cargo doc --workspace --no-deps + + # Run the (very minimal) compile environment [script] compile-env *args: @@ -514,7 +530,7 @@ print-container-tags: # Run Clippy like you're in CI [script] -clippy *args: (cargo "clippy" "--all-targets" "--all-features" args "--" "-D" "warnings") +clippy *args: (cargo "clippy" "--workspace" "--no-deps" "--all-targets" "--all-features" args "--" "-D" "warnings") # Serve rustdoc output locally (using port 8000) [script] diff --git a/nat/src/lib.rs b/nat/src/lib.rs index b28d4b0d6..846ed54ad 100644 --- a/nat/src/lib.rs +++ b/nat/src/lib.rs @@ -3,6 +3,7 @@ #![deny(clippy::all, clippy::pedantic)] #![deny(rustdoc::all)] +#![allow(rustdoc::broken_intra_doc_links)] #![allow(clippy::missing_errors_doc)] //! Network Address Translation (NAT) for the dataplane diff --git a/tracectl/src/control.rs b/tracectl/src/control.rs index 9c8485419..941b5817c 100644 --- a/tracectl/src/control.rs +++ b/tracectl/src/control.rs @@ -372,7 +372,7 @@ impl TracingControl { Ok(db.default) } - /// Parse a string made of comma-separated tag=level; level = [off,error,warn,info,debug,trace] + /// Parse a string made of comma-separated tag=level; level = \[`off,error,warn,info,debug,trace`\] fn parse_tracing_config(input: &str) -> Result, TraceCtlError> { let mut result = OrderMap::new();